Jump to content
OMRON Forums

How to compile motion or PLC programs in RTX


SilentLee
 Share

Recommended Posts

We want to use RTX as our host system, Turbo PMAC USER MANUAL tells use VR_PMAC_WRITEBUFFER to download file, if I download them directly, it doesn't work; In PCOMM32, the download file function is PmacDownLoadA(),it first compiles motion or PLC programs and then download to clipper. How could I compile the programs before download them in RTX system. THANKS!
Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

The “VR_PMAC_WRITEBUFFER” can only send valid PMAC syntax ASCII text. You would need to provide your own parser to provide PLC compilation and pre-processor directives (#define, #include ...) as is done on our Pcomm32.

 

Where can I find the rules to compile and pre-process the programs? How Pcomm32 compile and pre-process these programs? It does not open to users?Thanks

Link to comment
Share on other sites

  • 2 months later...

What are you trying to download and how is it not working for you?

 

The "Ethernet Protocol" tells VR_PMAC_WRITEBUFFER is usually used for

downloading a file.

We download motion programs to clipper using VR_PMAC_WRITEBUFFER by ethernet communication as follows:

“OPEN PROG 1 CLEAR

Q1=Q1+1

CLOSE”

The responed string is:03 00 00 00. It indicates there's no error during downloading. However, we can't find the downloaded program. Why?

Should we complie the motion program before downloading? How to compile?

Otherwise, there is no definition of VR_PMAC_SENDCTRLCHAR and seveval little errors in "Ethernet Protocol".

Link to comment
Share on other sites

The data sent must have each line separated by null byte, ASCII 00 (0x00) - not a "carrage return+linefeed" sequence.

For your example you should be sending:

OPEN PROG 1 CLEAR<00>Q1=Q1+1<00>CLOSE<00>

 

I will have the software group add the description of "VR_PMAC_SENDCTRLCHAR". What other errors did you find?

Link to comment
Share on other sites

The data sent must have each line separated by null byte, ASCII 00 (0x00) - not a "carrage return+linefeed" sequence.

For your example you should be sending:

OPEN PROG 1 CLEAR<00>Q1=Q1+1<00>CLOSE<00>

 

I will have the software group add the description of "VR_PMAC_SENDCTRLCHAR". What other errors did you find?

 

The data I send was “OPEN PROG 1 CLEAR<00>Q1=Q1+1<00>CLOSE<00>”where <00> indicated ASCII 0. If using "carrage return+linefeed" sequence, downloading error would happen. Is there something I left out during downloading such as compiling or other procedure?

The errors I found were literal, among them were some questions.

Page 3

(1)Second line---->What did ^X mean?

(2)17th line---- There is no definition of FLUSH_TIMEOUT

 

Page 4

(1)Controdiction:29th line EthCmd.RequestType = VR_UPLOAD; 36th EthCmd.RequestType = VR_DOWNLOAD;

(2)Next-to-last line: Function “send” and “recv” did not use “outstr”! What was the role of “outstr” played in the example?

 

Page 5

(1)10th line: EthCmd.RequestType=VR_UPLOAD; EthCmd.Request = VR_PMAC_GETBUFFER;

18th line: EthCmd.RequestType = VR_DOWNLOAD; EthCmd.Request = VR_PMAC_GETLINE;

(2)22th line:What was the role of “outstr”?

 

Page 6

(1)In VR_PMAC_PORT, what was the meaning of “offset” and “outch”?

Link to comment
Share on other sites

The data sent must have each line separated by null byte, ASCII 00 (0x00) - not a "carrage return+linefeed" sequence.

For your example you should be sending:

OPEN PROG 1 CLEAR<00>Q1=Q1+1<00>CLOSE<00>

 

I will have the software group add the description of "VR_PMAC_SENDCTRLCHAR". What other errors did you find?

 

The data I send was “OPEN PROG 1 CLEAR<00>Q1=Q1+1<00>CLOSE<00>”where <00> indicated ASCII 0. If using "carrage return+linefeed" sequence, downloading error would happen. Is there something I left out during downloading such as compiling or other procedure?

The errors I found were literal, among them were some questions.

Page 3

(1)Second line---->What did ^X mean?

(2)17th line---- There is no definition of FLUSH_TIMEOUT

 

Page 4

(1)Controdiction:29th line EthCmd.RequestType = VR_UPLOAD; 36th EthCmd.RequestType = VR_DOWNLOAD;

(2)Next-to-last line: Function “send” and “recv” did not use “outstr”! What was the role of “outstr” played in the example?

 

Page 5

(1)10th line: EthCmd.RequestType=VR_UPLOAD; EthCmd.Request = VR_PMAC_GETBUFFER;

18th line: EthCmd.RequestType = VR_DOWNLOAD; EthCmd.Request = VR_PMAC_GETLINE;

(2)22th line:What was the role of “outstr”?

 

Page 6

(1)In VR_PMAC_PORT, what was the meaning of “offset” and “outch”?

 

 

I recommend you download the program at the following link it is great for helping debug your program. http://hercules-setup.findmysoft.com/# Below is an example screen shot of correctly sent data. You can print your data as hex variables before your send command to find the problem and compare it to what is in hercules.

image001.png.c7022c6534f3a4e5b7c54bd833f60172.png

 

The first line is a get response of I10. The second command is a write buffer command. And the third is a getresponse of list plc 1 which returns the plc we wrote.

 

Regarding the manual ambiguities

^X stands for Control-X which is hex value 0x18

EthCmd.wValue for VR_PMAC_FLUSH is irrelevant so you can set FLUSH_TIMEOUT to 0.

 

VR_PMAC_GETBUFFER and VR_PMAC_GETLINE should have been documented to use VR_UPLOAD for the requests however either would work. In addition, neither one of these really use outstr so EthCmd.wLength should be 0. It appears to be a cut and paste mistake from copying GetResponse.

 

For VR_PMAC_PORT offset is the offset from the DSP base host port and outchar is the data to write into the port. You should have no reason to ever use this command.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...