help needed with scale RS485 communication

Hey,

i'm a software engineer, and getting started in PLC programming with phoenix contact / plcnext

i don't know a lot about the wiring aspect of the PLC world.

i'm trying to test out a scale serial communication, its easy with a rs232 to USB adapter, but this project its not possible to connect via usb.

i have a scale with rs232 output, a rs485 converter, and a plcnext rs485 smart module

can someone help me with the wiring and if you know the plc next engineer steps to receive the weight via rs485

i've done other projects with plcnext controls, so i know a bit about getting the modules configured and all that. this is the first time i've had to use serial communication.

there isn't a lot to google with plcnext because its still fairly new and there isn't a lot of content.

scale -> rs232 -> rs485 -> plc

i think the wiring is hooked up right but just to confirm if someone knows for sure. its tx+ tx- rx+ rx-

johnny
 
RS-232 is not directly electrically compatible with RS-485. How are you going to resolve that?

What does your converter convert? RS-232/RS-485?

Assuming you have an RS-232/RS-485 converter, the conerter module documentation should show you how to wire the RS-232 side.

RS-485 is most commonly used in simplex mode, one side talks, the other listens (not duplex mode where both side talk and listen at the same time).

For simplex RS-485, if the are 4 terminals (Tx+, Tx-, Rx+, Rx-), then one jumpers the positives to one another and the negatives to one another at each node:

Tx+ jumpered to Rx+;
Tx(-) jumpered to Rx(-).

Then the devices connect over RS-485 to one another with (+) to (+); (-) to (-), signal ground to signal ground.

Daisy chani.JPG

Coding for proprietary serial comms is outside my expertise.
 
Many weight scales with RS-232 output use their own, simple ASCII protocol for communication. This protocol should be documented in the scale's user's manual.

I recommend first trying to communicate to the scale using your computer, a USB to RS-232 adapter, and a terminal emulator such as PuTTY to make sure you understand how the protocol works. After you've successfully done this, then move on to programming your PLC.
 
ive used this scale many times with a virtual com port.

i have the wiring hooked up and i'm able to send data but it never has anything to receive.

the PLC keeps adding the length of the data i'm sending in front of the actual data which the scale does not like

i'm sending "Q\r\n"

[0] = 00
[1] = 03
[2] = 81
[3] = 13
[4] = 10

i am not telling it to send 00 and 03, i don't know why its adding this but that is what is stopping me right now. i have a line with guys at phoenix contact and hopefully they will respond today.
 
i have a zm405 indicator and a rs485 option card

when i talk to it i get all dollar signs back....... it shouldn't be this fucking hard
 
OK, I understand this is frustrating, because yes, it should not be that hard.

But let's make sure you're focusing in the right places. You previously stated you've successfully used the ZM405 scale many times with a virtual COM port. Was this with the RS-485 option card and using a USB to RS-485 converter on your computer? Try confirming this now and rule out the the scale as being the source of the issue.

You also said your PLC is sending 00 03 bytes at the beginning of your message, which should not be there. Have you resolved that issue?
 
sorry that was a different scale, this is just a indicator with a load cell

i get the correct weight on the indicator.

but the serial communication just sends back 17 bytes, all dollar signs
 
i should be more clear this is completely different

i'm not sending any information to this indicator, it just streams the weight out through the rs485 option card. or at least its supposed to.

load cell -> indicator -> rs485 option card -> plc

it just sends 17 dollar signs
 
Thank you for clarifying. Did you ever resolve the issue from your original post?

Do you have any documentation available on the ZM405 about its RS-485 communication? The manual is very sparse with details in its communication section, but I'm guess it continually streams ASCII characters in one of the default print formats. However, you need to know the baud rate, parity, number of stop bits, and number of data bits in order to receive this data on another RS-485 device.

Dollar signs may just be a placeholder for invalid ASCII characters due to one of the aforementioned settings being incorrect.
 
yeah the manual doesn't say anything about the serial communication. i just used the normally ok default settings

i've tried two different combinations of settings. i guess i could do some trial and error
 
i looked through the manual and set it up and then matched the plc serial config

its not sending anything.

maybe there is another setting on the indicator to use the serial output

it asked if i wanted to allow software xon / xoff control.

not sure how to send xon if thats what is needed
 
XON/XOFF is software flow control. Using it would require you to send XON and XOFF control characters. XON would turn on transmission, while XOFF would stop transmission.
https://en.wikipedia.org/wiki/Software_flow_control

There's also hardware flow control (RTS/CTS, DTR/DSR), but this can only be used with RS-232, not RS-485.
https://en.wikipedia.org/wiki/Flow_control_(data)#Hardware_flow_control

Setting the flow control to "None", which is the default, should result in the device transmitting periodically on its own.
 
What protocol is the ZM405 configured to use under Admin->Ports->Protocol?

It appears the ZM405 supports several different protocols and supports both serial and Ethernet communication. It seems the intended method of communicating to a PLC is using the Ethernet port and either the Modbus/TCP protocol or EtherNet/IP protocol. Does your PLC have an Ethernet port? If so does it support Modbus/TCP client or EtherNet/IP client?

It appears, though, you may need to obtain the ZTools software from Avery to configure the data accessible over Modbus/TCP or EtherNet/IP on the ZM405.

If you must use RS-485, then perhaps one of the other supported protocols (SMA, ENQ, B-Cast, NCI, or R-DISP) may be easier for you to use than the default Print protocol. Details on these protocols are in Chapter 7 of the Service Manual.
 
I am struggling with a similar setup but some information may help here. I have the Avery ZK830 with PLCNext via RS232. The B-cast protocol was the default on my device but I have switched to SMA to be able to Tare the balance from the PLC. I have matched all the Serial settings on both devices (9600 Baud, 7 Data bits, Even parity, 1 stop bit) and am running data through the AXL_RSUNI_PD_4 serial function block. Based on the manual, I am sending "line Feed, W, Carriage Return" to return the weight of the current scale. The data is being received into the output Process data array then transferred to my receive array but instead of remaining stable, it alternates between being full of weighing data then to almost empty except for the first 6 bytes which are DLE, SOH, ETX, g, (space), Carriage Return. My feeling is that the data is too big for the process data array which is 20 bytes with 17 reserved for the user data, however the data from the scale is also 20 bytes (<LF> <s> <r> <n> <m> <f> <xxxxxx.xxx> <uuu> <CR>) so I think it needs to send in 2 parts or possibly this is just causing some other problem resulting in the fluctuating behavior.
 
before i read your post, i'll just say that i got the indicator working but i had to call their tech support. the reason it wasn't doing anything is because there was no "print format" setup.

once the helped me set that up in the indicator it worked.
 
I am struggling with a similar setup but some information may help here. I have the Avery ZK830 with PLCNext via RS232. The B-cast protocol was the default on my device but I have switched to SMA to be able to Tare the balance from the PLC. I have matched all the Serial settings on both devices (9600 Baud, 7 Data bits, Even parity, 1 stop bit) and am running data through the AXL_RSUNI_PD_4 serial function block. Based on the manual, I am sending "line Feed, W, Carriage Return" to return the weight of the current scale. The data is being received into the output Process data array then transferred to my receive array but instead of remaining stable, it alternates between being full of weighing data then to almost empty except for the first 6 bytes which are DLE, SOH, ETX, g, (space), Carriage Return. My feeling is that the data is too big for the process data array which is 20 bytes with 17 reserved for the user data, however the data from the scale is also 20 bytes (<LF> <s> <r> <n> <m> <f> <xxxxxx.xxx> <uuu> <CR>) so I think it needs to send in 2 parts or possibly this is just causing some other problem resulting in the fluctuating behavior.
Have you tried using a terminal emulator on your computer to test communications with the ZK830 and see the exact response message for the command(s) you're trying to send from your PLC?

before i read your post, i'll just say that i got the indicator working but i had to call their tech support. the reason it wasn't doing anything is because there was no "print format" setup.

once the helped me set that up in the indicator it worked.
Wouldn't that only apply when "Print" is selected for the protocol under Admin->Ports->Protocol?
 
Have you tried using a terminal emulator on your computer to test communications with the ZK830 and see the exact response message for the command(s) you're trying to send from your PLC?
Thanks for the suggestion. I have not tried that. I will look into it. I just added a condition in the PLC code to ignore the process data that is not structured properly (only update weight variable if the decimal point and units are in the expected position in the array). However, I could be losing some response speed with this method since it appears to be ignoring every other transfer. Luckily, the 3 bytes that I am missing do not have any data I need.
 
Top