Master Mode Query

I have the profinet io to rs232 gateway. I am trying to get the profinet io device to talk with a machine that only accepts ascii via rs 232 via query/response. I can get the gateway to show the data that I send to it via profinet in the out area of node monitor but am unable to get device to respond. The device is looking to get a comma or carriage return at end of query to prompt a response. Need to make sure I have set up the transaction correctly and I do not understand how the Byte constant for Query is used.

Hello @howard,

I am assuming you are using a communicator here. It does not look at the data types itself and is just sending the byte data as it is received from the PLC. You should be able to use the value of the ascii character to send it over the serial side.
The following program is setup with produce transaction with 10 bytes of data from the PLC then a comma and a carriage return. The comma and carriage return are added using byte constants.
example 10 bytes comma CR.cfg (16.0 KB)

Ascii Table - ASCII character codes and html, octal, hex and decimal chart conversion

Let me know if this helps or if you have additional questions.

Attached is my config. That I am using that seems to match what you are showing other than you stating a generic mode whereas we set at master mode as we are expecting a response. I

I am sending a text string to the communicator via profinet and expecting it to pass that via RS232 to the machine and then machine responding back with final character being new line.

Below is equipment manual information on communicating with it and example below is showing query and response.

The carriage return is shown for ending send and I am using comma which per their documentation is acceptable alternate. I have not seen a different with using carriage return.

image004.png

image002.jpg

image003.gif

PMPmydax.cfg (16 KB)

Hi Howard.

You might want to use a static data object rather then a varaible data object or add an delimiter/end character to the variable data object so the message knows when the text ends and doent include extra 0’s. You can check this by looking at the message in the log. This will show you the data sent out and received on the bus.

Deryck

Since the machine is expecting RS232 query of variable length I will need to stay as variable object. Since the machine is expecting a comma or carriage return to signify end of the request would I include this by changing the object delimiter to end character visible and indicating the appropriate end character value for comma or carriage return. See attached change to cfg. Does this impact the Byte Constant as I thought that was sent at the end of query data object.

My real question is how do I get the machine to see an RS232 instruction for example “GO,” if I need to have variable data length?

Thanks

Howard

image002.jpg

image003.gif

PMPmydax R1.cfg (16 KB)

Could you include the comma in the data sent by the PLC? It might make sense to set up the query to use that as the delimiter for the variable data object. You would also remove it as a constant in the query.

PMPmydax R1 HMS.cfg (16.0 KB)

I can definitely put the comma in string to the communicator. I will try the config that you sent next week when I am back on site.

Thanks

1 Like

Hi Howard,

Did you have any luck with the new config?

Deryck

I plan to be on site tomorrow and will test and let you know.

Thanks for checking in.

Howard

So I did some additional testing to ensure the RS232 to the device was working before continuing.

It is working, so I went back to testing the Anybus. It turns out that sending a text string to the Anybus is not being interpreted as expected. However if I send the Hex equivalent of the ASCII string the Anybus transmits that to the machine and machine sends back a proper response. What is interesting is after the machine sends the proper response it sends a whole bunch of extra information.

image002.jpg

image003.gif

Hi Howard,

The ewon is going to send out the values that at it is given and is doing not interpreting or altering the data. I would expect you to be sending the value of the ascii character how this is done would depend on how the Master or the software of the master is handling it. For example in Logix you can view the ascii value of of a sint.
image

The device could be sending a fixed length and is padding the data or it is configured for more data. You will want to verify the format it uses.

Deryck