help with scale and rs485

jbliss15

Member
Join Date
Feb 2022
Location
OR
Posts
19
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
 
oz5HIyfYOnR97fb1a-t7h_yvTX5RYg2iZyuJAAyrgjsrK2x-TN9wHOof-FCn2ZA-MTawKYQ4Q-PzXMPMZzNNhKtFX-raB6PB1gwel1fclizkA2nwZJjURAF6CmuZ7-t1ITmep5-2JlX1ADjRJw4zjP68uoipT5hZiBJ1_gOTGmTQQ0-8tw6XGv6ZCpYm3xqD3gQ_zgWhW98gcGoY1XPRVMOMmRVw6pog32Xsbv1CFagT4vEIr22v26Aj2cZj6yByYveGzxdZoZyhC_1EMVlN4vUt2o35b5fL06Ze7gh_MIZMY0GH_Xa5DWBzIBz1U_wc1CilKiV47jEKdL-EDB6yEZ7jsiS-TlPUGjDITBmdo2WmDNMOCAtRmwLW401ya8C8lAaHavXMR24x8brLSYBHqh1GBbxn7RNWj7l3MXhR0W5qe2ZPaTl2uIT5UonKxdJsusFXdK6D8m25ErvNvrUiJZ0az-i869SzlgaGqYRDsqX39I1sTprQxycw6ofqGpGWEmr5hPfG9WEj3ayqDihmTeuLVbllPD5DEimTfmkAaBPFqNg-a3Clj544FcEeuhTibRyJsMpWQFdby50ZJjXMGc485_QWMAQxdmdSx5C-MY5S0ViObhh53ytjUgItZCxWwv6nPBVJ2aC46HLqaEmfpzpnWmUafqWSACfGIb5UzdsoWKaxGrKekTqfEmNpebkhHRlDTqmhZhuYObUEM9RxfJLdQA=w2240-h1261-no


BA_Dn6viamNzRAo1YflwGlI4695GOZUdZ3ihFPjXhm-NgZQ2DFO00UgVxaVpGtrIZrFEFX40_SiDNhuC3m1Og2RJ4bAkc3PZRTvsI6dQZvY21nv1vUg6NwiPrAIeUur2z0wqmZRmhHCWPF6dIfUTwDCh0_H1wf9JRUnYlBV0eLZur2rjQZGKML4WtuwbQ-IwJ30CLWL8Q2Cp4dM_4GYfZK5zpMpkCNxzDFyj_JE4QNXH5Lo0w8mP5y8kpKsacgBOWWRkxZyI_osrP2jz9sm8DeQCJm6rwOsjU_S_pl90OjHYCARraV8vkyUocRAvJUxcJOYU_uHxBtVhPmE1fZuHFiRlaEgtdmO_jzAidGQgZuJs0-b3EmMhDnT3BdRMMkwGcsChXjL4jxdVTujPo9GN2LQBCoQ0GKUrssprL3R0MGOHA2tg_J6YhmD5_RDwFQLYXSOzGIANXh9bCKIvMcxevoPZDHqyV3fmu5l4TP15OuxCwZLe_uqYin_fYgpUAGSEY_ovkfoMhlgfXY0ytAbBrLAHHArNZN2asljQFqnLw7WnHGUZHc9q1sL8AhfDLSHW94WHzDVVCqdms7Lrh32ci0nNyA2WhOpnAwbUkgoVLHVaCL28fiefUaJqWQY-grqrXpQ8_BuAqsAZy0zj7tf62HsJBWbG3q99BP4OEjzE9q5pUQ5jJpSBrVkSXYV8K-NGqZeuiE4oVeCrkRboBOtUpHPaDg=w2240-h1261-no
 
Without knowing the make of modules you're using, it's pretty impossible.


+1


It sounds like the scale is RS232, and there is an RS485 interface on the PLCNEXT.

What I would do is approach it incrementally: use the USB-RS232 cable to connect the PC (Windows or Linux) to the DLTECH RS232 side (DB9?) and the DLtech RS485 side to the PLCNEXT, and see if you can send any characters (e.g. the query string for the scale, or even just "ABC") from the PLCNEXT and read it on the PC. E.g.

% python
>>> import serial
>>> ser=serial.Serial('/dev/ttyUSB1')
>>> while True: b=ser.read(1); print(('{0:02x} {0:03d}'.format(ord(b.decode(encoding='8859'))),b,))


Then you can swap around the pinouts, wiring, baud rate, data bits, stop bits, parity, etc., until it works.




...
 
Last edited:
+1


It sounds like the scale is RS232, and there is an RS485 interface on the PLCNEXT.

What I would do is approach it incrementally: use the USB-RS232 cable to connect the PC (Windows or Linux) to the DLTECH RS232 side (DB9?) and the DLtech RS485 side to the PLCNEXT, and see if you can send any characters (e.g. the query string for the scale, or even just "ABC") from the PLCNEXT and read it on the PC. E.g.

% python
>>> import serial
>>> ser=serial.Serial('/dev/ttyUSB1')
>>> while True: b=ser.read(1); print(('{0:02x} {0:03d}'.format(ord(b.decode(encoding='8859'))),b,))


Then you can swap around the pinouts, wiring, baud rate, data bits, stop bits, parity, etc., until it works.




...

thanks for reminding me i need to send Q\r\n to this scale to get the weight back. i totally forgot about that.

its been a while since i did any serial comm with scales
 
Btw, those images don't display any more. I suggest uploading them (use the advanced interface for making a new post, and look for the paper clip icon to upload files).
 
I would guess you need summat like Figure 3 in the data sheet, available under [Downloads] here., and the figure in the DLtech manual here, so

  • DT-9xxx [1 T/R+] is wired to AXL [1 RxD+,TxD+],
  • DT-9xxx [2 T/R-] is wired to AXL [3 RxD-,TxD-]
  • You might* need termination resistors (120Ω)
    • AXL [6 R+] to AXL [0 T/R+]
    • AXL [7 R-] to AXL [2 T/R-]
* I have gotten away without termination, but that was usually point-to-point on the bench; I found serial comms to be fairly forgiving in a testing environment; once I ginned up a DB gender change using paper clips.
 
yeah it never fills the buffer before i try to read it.

nothing is ever there.

i need to send Q\r\n to the scale, and it will return the weight.

when i edit the var senddata[0] = 81, [1] = 13, [2] = 10 into the bytes that are supposed to be sent.

when i look at the output of the code module. its sending:

output[0] is bouncing back and forth between 70 and 30
[1] = 00
[2] = 03
[3] = 81
[4] = 13
[5] = 10

in plcnext engineer the values show as 16#81, 16#13, 16#10 etc...

i don't think im sending the right bytes to get a reading back

but i've also tried the scale in streaming mode where it should constantly be sending a value back. but nothing happens
 
Can you get it to send data back to the PC (Linux /dev/ttyUSBn or Windows COMn)?


What are those first two bytes (00 and 03)? Are they being sent to the scale? Is that the length of the reset of the string (Q\r\n)? I don't think that should be sent.
 
Can you get it to send data back to the PC (Linux /dev/ttyUSBn or Windows COMn)?


What are those first two bytes (00 and 03)? Are they being sent to the scale? Is that the length of the reset of the string (Q\r\n)? I don't think that should be sent.

Yes I've used this scale before on other projects with a virtual com port, works really easy

I don't know why it'd sending those two bytes before what I want sent. The module that facilitates the communication is from Phoenix Contact and I can't look at the code

I asked the guy from Phoenix Contact I was working with but he hasn't responded yet
 
Do you have another DLtech DT-9xxx converter? Because the scale is essentially a server, but because it is RS232 it is designed to be a point-to-point device. However, on the RS-485 network side of the DT-9xxx you can have multiple nodes. So if you have an extra DT-9xxx converter, you could put the PC on that network and have it send the Q\r\n string, and then the scale would respond and the PLC would see the scale's response. The only problem would be getting the PLC to ignore the Q\r\n string. Or instead of the Q\r\n you could have the PC send the "start to stream command" and then the PLC would see a continuous stream of data.

This is only an idea for bench testing. The right fix is to get the PLC to not put the two [00 03] bytes on the wire. I suspect the PLC is sending the entire string object, not just the string, and the string object comprises two items: a 16-bit integer length of the string ([00 03]), and the three characters of string data themselves (Q\r\n).
 

Similar Topics

Good day all, I am having bit of an issue getting my head around this RTD scaling issue. Be forewarned, my head has been known to be "THE" issue...
Replies
24
Views
8,853
Hi all, Can someone direct me int o how to calibrate my scale connected to my 1769 analog input 0 - 10 V input voltage to the card is 1.66VDC...
Replies
2
Views
1,567
I have an automated batching system that im using an analog scale to trigger automated valves to open and close. I have the programming done and...
Replies
6
Views
2,355
I have a Omega Scale controller that we just purchased. It has an Ethernet connection. It is the CNi852-C3EIT. I need to connect it to my...
Replies
6
Views
2,181
I have shot myself in the foot - per se'.... I have a customer with a scale panel that has four Rice Lake scale heads in it. I was able to...
Replies
11
Views
3,776
Back
Top Bottom