Digital Dream Technology support

Title: DDCSV macro description [Print This Page]

Author: ytliu    Time: 2018-2-24 20:14
Title: DDCSV macro description
Last edited by ytliu In 2018-2-24 21:01 Editor

DDCSV system supports macros. Macros support loops, conditional control languages, and common maths function calls.

For user processing files whose size is less than 100K or whose initial character name is sys, the system automatically scans the program structure before processing or emulation so as to implement the loop and branch statement support.

Note: The main program number of macro processing program defaults to 0.

Example:
Processing file: sysuser1.nc
O0000 (main entrance)
...
M98P0001L3 (call subroutine No.1 three times)
...
M30

O0001
...
M99


Author: ytliu    Time: 2018-2-24 20:15
DDCSV macro variable Description:

#0- #49 for each subroutine internal private variables;
#50- #499 is the system internal variable area 1;
#500- #999 is the system parameter area;
#1000- #1999 is the system internal variable area 2;

The chs or eng file defines the system parameters that the user needs to configure, for example:

#1 -t2 -s1 "language setting" -m16 -min = 0.000 -max = 1.000 -i0 "Eng" -i1 "Chinese"

#n n is the parameter number (0-499), n + 500 is the macro variable number of this parameter;
-t is used to specify the type of parameter, t0 is an integer, t1 is a real number, and t2 is a selection type.
-s1 defines the name of the parameter;
-s2 defines the parameter unit;
-m parameter group, m0 that the parameters in the parameter configuration page does not show;
-min minimum parameter
-max maximum parameter
-i The text of the relevant entry is configured through it when the parameter type is selection type;
Author: ytliu    Time: 2018-2-24 20:15
Last edited by ytliu In 2018-2-24 21:02 Editor

DDCSV Coordinate System Description:

The coordinate systems in DDCSV system include machine coordinate system, G53 coordinate system and G54-G59 coordinate system.

The machine coordinate system is established by home operation or zero under MACH. Read # 864- # 867 (X, Y, Z, A) to find the position of the tool in the machine coordinate system.

G53 is based on the machine coordinate system. # 800- # 803 (X, Y, Z, A) describes the distance from the origin of the G53 coordinate system to the origin of the machine coordinate system. Adjusting these parameters can reconstruct the G53 coordinate system. Read # 868- # 871 (X, Y, Z, A) to find the position of the tool in the G53 coordinate system.

The G54-G59 coordinate system is based on the G53 coordinate system. # 804- # 807 (G54 X, Y, Z, A), # 808- # 811 (G55 X, Y, Z, A), # 812- # 815 (G58 X, Y, Z, A), # 816- # 819 (G57 X, Y, Z, A), # 820- # 823 G54 X, Y, Z, A) respectively describe the distance from the origin of G54-G59 coordinate system to the origin of G53 coordinate system, and adjust these parameters to reconstruct the G54-G59

coordinate system; Read #840-#843(G54 X、Y、Z、A)、#844-#847(G55 X、Y、Z、A)、#848-#851(G56 X、Y、Z、A)、#852-#855(G57 X、Y、Z、A)、#856-#859(G58 X、Y、Z、A)、#860-#863(G59 X、Y、Z、A)to find the position of the tool in the G54-G59 coordinate system.

#516 describes the system currently working coordinate system, 0 corresponds to the G53 coordinate system, 1-6 corresponds to the G54-G59 coordinate system, 7 corresponds to the machine coordinate system.
Author: Will_D    Time: 2018-2-25 22:06
Many thanks for this information. It is very useful.

One question though
I am still using version 1.1

I am trying to write a tool change macro.

Parameter #268 is "H01 tool offset"

If I set this and others to know values I cannot see the value as parameter #768. Its value is 0
Author: ytliu    Time: 2018-2-26 11:15
Will_D Posted at 2018-2-25 22:06
Many thanks for this information. It is very useful.

One question though

version 1.1 and version 2.1 is same in macro.

My English is poor. I did not understand the last sentence.Please explain further.
Author: Will_D    Time: 2018-2-26 18:01
Last edited by Will_D In 2018-2-26 19:11 Editor

Your Englisdh is much better than my Chinese!!

Thanks for the reply (and also the tool change macro example - will try this out later )

My question is:
If I set parameter #82 to 20.00 (Safe Z retract Height) in my controller, I can then use #582 in my script as it will equal 20.00

If I set parameter #268 to 10.00 (H01 tool offset) in my controller, I can see that #768 in my script is set to 0.00

Will

{UPDATE}

My mistake. I forget to send the M3 command!! Now all works

Author: JPoepsel    Time: 2018-2-26 19:48
Will_D Posted at 2018-2-26 18:01
Your Englisdh is much better than my Chinese!!

Thanks for the reply (and also the tool change macro ...

Hi ytiu!
Your answer proofs, that at least I was not completely wrong with the reverse engeneering in madmodder.net (see https://madmodder.net/index.php/topic,11598.875.html) ;-)

One question:

In  macro O102 I found the

RDRECODE[#1]

instruction. Have you any informations what it does?

Second (and last) question: Is there any chance to place text on the display (e.g. as hint for the user for manual tool changes)? I know, that comments in the G-Code are displayed (e.g. the line "M5 (Change to tool 1!)" will display the comment), but the possible text size is somewhat small and there is no way to change this comment in macros e.g. depending on the tool number).
Users of Fusio0n360 and other software using a posts for GCode-generation have the alternative to implement the GCode commands in the post (for Fusin360: using Javascript), but implementing it directly on the device is far better for the "value" of the DDCSV ;-)

All the best and thanx again for your answers!

Josef



Author: ytliu    Time: 2018-2-26 21:46
Last edited by ytliu In 2018-2-26 21:48 Editor

Hi JPoepsel!
102 subprogram is used to play back the track of the tool. Before using the 102 subroutine, the track must be recorded, the attachment is an example related to it.

track.rar

420 Bytes, Down times: 2060


Author: Lukasz    Time: 2018-3-1 22:17
Hello ytliu,

Are there any other commands (like RDRECODE, WRRECODE) available? Could you provide some command list?
For example to send data to MPG RS232 port?

Regards
Lukasz
Author: Will_D    Time: 2018-3-2 07:09
ytliu Posted at 2018-2-26 21:46
Hi JPoepsel!
102 subprogram is used to play back the track of the tool. Before using the 102 subrout ...

Few of us have rar. Please use .zip format
Author: ytliu    Time: 2018-3-2 07:36
Will_D Posted at 2018-3-2 07:09
Few of us have rar. Please use .zip format

Hi!
Sorry, I will use .zip format later

track.zip

565 Bytes, Down times: 2862


Author: ytliu    Time: 2018-3-2 07:38
Hi Lukasz!
DDCSV through RS232 protocol bus IO expansion, the current version does not support communication with the serial MPG.

Output data packet 7 bytes, including three parts:
1. Data packet header 2 bytes "0x90 0xeb"
2. Output IO word 4 bytes, 0 bit -31 bit are mapped to # 1032- # 1063 macro variables
3. the checksum, XOR result of the first 6 bytes

Input data packet 7 bytes, including three parts:
1. Data packet header 2 bytes "0x90 0xeb"
2. Input IO words 4 bytes, 0 bit -31 bit are mapped to # 1000- # 1031 macro variables
3. the checksum, XOR result of the first 6 bytes

Bus output IO signal Instructions for use:
Change the IO status by assigning the relevant macro IO bus output
Example:
# 1032 = 1; set bus IO channel 0 to logic '1'

Bus input IO signal instructions:
M100 bus input IO instruction
#1100 Bus input IO channel number
#1101 Bus input IO expectations value
#1102 waiting time (ms),if <= 0, infinite waiting for the signal to reach the desired value; if> 0,   if the signal does not reach the expected value within the specified time,paused.

Example:
(If channel 2 is logic '1', subsequent codes are executed; otherwise, pauses after 1s.)
# 1100 = 2
# 1101 = 1
# 1102 = 1000
M100
...
Author: Lukasz    Time: 2018-3-2 15:49
Dear ytliu,

This is the best information of a day !!! This is what I was expecting. And after some quick check - IT WORKS
Thank you for a great support.

Regards
Lukasz
Author: Will_D    Time: 2018-3-2 19:19
ytliu Posted at 2018-3-2 07:36
Hi!
Sorry, I will use .zip format later

Many thanks for the zip
Author: Rust    Time: 2018-4-17 21:58
Hello
I tried to use a subroutine, but it does not work
Could you help me
1: does not work
N150 G1 G91 X100 F1000
N160 M97 P500
N200 M02
N500 G1 Y100
N510 M99

2: does not work
O000
G1 G91 X100 F1000
M98 P0001 L5
M02
O0001
G1 Y100
M99

3:does not work
O0000 and O0001 in the different files

What's wrong?
Author: JPoepsel    Time: 2018-10-22 15:57
Last edited by JPoepsel In 2018-10-22 19:24 Editor
ytliu Posted at 2018-3-2 07:38
Hi Lukasz!
DDCSV through RS232 protocol bus IO expansion, the current version does not support commu ...

Hi ytliu!

You mentioned how to read/write 32 bits by the RS232 IO expansions.
Well, I'm just planning to do automatic tool changing with the DDCSV using M8/9 M10/M11. This two IO-pins may be enough, but when I plan a self-sufficient tool change e.g. by a tool change carousel, the tool changer needs the desired tool number… So I'm thinking about adding an ESP32 (or something similar) controlling the tool changer and communicating by serial IO with the DDCSV. Do you think, that may work (of course with some macros)?
The Question: you mentioned how the IO bits are mapped to the internal variables, but did not mention how to start writing/reading over the serial port. If I understand it right, M100 will do the job for reading (I understood, that  M100 will wait for a specific bit change but I guess, all 32 bits will be updated to the internal variables with this instruction), but you did not mention how to SEND bits. Or does M100 first send and then read the bits all together?

Would be great to get some hints.

Josef

P.S.: Silly Question: Is the "serial port" the one feed out on the MPG conector or the internal one as it can be seen here: http://bmuessig.eu/ ?

Author: ytliu    Time: 2018-10-22 20:34
Last edited by ytliu In 2018-10-22 20:42 Editor

Hi JPoepsel.
the "serial port" is the one feed out on the MPG conector.

Sorry, I am still on a business trip, and I will sort out the relevant information when I go back.


Author: ytliu    Time: 2018-10-28 09:31
You need to design an IO expansion board similar to the one below and write the expansion board program according to the serial protocol described earlier. Then install the files in the attachment to the controller.


The attachment is an extended M command installation package.
M200: set bus outport channel 0 to logic '1'
M201: set bus outport channel 0 to logic '0'
M202: set bus outport channel 1 to logic '1'
M203: set bus outport channel 1 to logic '0'
...
...
M222: set bus outport channel 11 to logic '1'
M223: set bus outport channel 11 to logic '0'

M300-M315 corresponds to the level detection of 0-7 bus inport channel, no corresponding level will keep waiting.

IO扩展板.png (748.42 KB, Down times: 1285)

IO扩展板.png

install.zip

10.25 KB, Down times: 921


Author: ytliu    Time: 2018-10-28 09:58
Last edited by ytliu In 2018-10-28 10:26 Editor

When #108(M Bus IO command response) is set to 1 (yes), DDCSV periodically generates an output IO instruction packet according to the #1032-#1063 macro variable and sends it. In addition, DDCSV will periodically receive the bus input IO instruction packet and update the #1000-#1031 macro variable according to it. The #1000-#1031 update is real-time, which means that as soon as the bus input IO packet is received, #1000-#1031 will be updated.
Author: JPoepsel    Time: 2018-10-29 15:46
Hi ytliu!

Hope, your trip was successful!
Thank you for your reply! This is, was I expected… So, with this information the DDCSV is ready to become a general purpose controller and the way is open to do a bunch of “special” things, I never thought of when buying it. Thank you again!
One last question (yes, I know, I can measure it by myself, but it is easier for me to ask you than to loosen several screws ;-)): Is the serial IO 3,3V, 5V or 12V?

Regards

Josef


Author: ytliu    Time: 2018-10-29 16:12
Serial port interface uses Max3232 device
Author: JPoepsel    Time: 2018-10-29 18:56
What a pitty - I hoped to be able to connect th microcontroller directly ;-)
Author: JPoepsel    Time: 2018-11-12 15:58
Good morning!

During weekend I figured out how to deal with the serial interface. I got it enabled and could decode the cylic output with my osciloscope as described by ytilu. BUT: The voltage range of TRX is from 0.0V to 1.5V relative to GND, not as expected from -12V to 12V. I don't think, this is normal, is it?

Josef
Josef

Author: 71taa    Time: 2018-11-12 16:13
Interesting info, hope to try it soon.

One of examples - periodical sending of current coordinates to external serial device. E.g. to scan heights on reference points, etc.
So If I'd like to send current coordinates of X (just for example, purely for education needs) via current scheme ("signal bits") following information could be helpfull:
1. Are there bitwise operators being supported by the G-code intepreter? AND or XOR for example. I know Fanuc supports them, does DDCSV supports them too?
2. Ability to apply bitwise operator to the contents of the macro variable containing coordinate piece?
3. Bit format of the internal coordinate representation. Though it could be reverse engineered if it's possible to apply bitwise operator to the macro variable ;)
4. Frequency of packet sending
5. Port parameters (baud rate, bit configuration)

If DDCSV have no control on packet sending I'll need to reserve some bits for status indication (e.g. packet ready/finished), so speed parameters are crucial here (as several packets are needed to send a single coordinate piece, and to send all three/four - it's even more time).
Author: ytliu    Time: 2018-11-12 23:18
Hello 71taa

      Currently DDCSV2.1 only supports simple serial protocol, and can not use macro program to control sending and receiving.
       The DM500 Handheld CNC Motion Controller supports the MODBUS communication protocol, and the data transfer can be controlled by a macro program to meet your needs, you can try it.


Author: ytliu    Time: 2018-11-13 18:15
https://www.facebook.com/groups/ ... k/2530082060342283/
Author: JPoepsel    Time: 2018-11-14 00:18
Hi all!

Concerning the default value of the Serial Output when enabled with parameter #108:
The value for #109 in the eng (rus...) file is defined as

#109 -t0 -s1 "M Bus IO default status" -m7 -min=0 -max=4294967295

But it seems, that the t0 type input with integer numbers is only possible for 16 bit unsigned values so that the maximum value, which can be set when using the parameter setting page is 65535.
Changing  to

#109 -t0 -s1 "M Bus IO default status" -m7 -min=0.000 -max=4294967295.000

does not realy help. To conclude: it is not possible to set the default values for the 3ed and 4th byte of the serial stream. Not so important, but may be changed in a future version.

BTW: The 0V..1.5V output peak for TRX was my fault. I exidently got the neighbouring cable and the values there did only exist caused by a cross-talk effekt ;-(

Josef

Author: ytliu    Time: 2018-11-17 06:39
Thank you for the information provided.
Author: Bomb    Time: 2022-1-23 04:52
Hi!
How to recofigure M-code in DDCSV2.1 ?

I wish to change M-code for my own needs.

Author: juliokosblanks    Time: 2022-4-21 02:25
Hey good afternoon!

I have a DDCS 3.1 and I really need help because I can't configure the functions that my machine has.

When I click RESET on the command, I need it to trigger an external relay that releases the brake of a motor. When the motor goes into alarm, it must activate the RESET and necessarily deactivate the motor brake relay.

Is this possible configuring only the DDCS or is it possible to do this through a macro?

I also have a spindle turning function for 2 sides and the M3 works correctly in my inverter but the M4 does not... is it possible to configure the M8 to trigger an external relay that can turn my inverter the other way?

Thank you very much and I hope I can solve this problem




Welcome Digital Dream Technology support (http://bbs.ddcnc.com/) Powered by Discuz! X3