Help needed with RS232 on RS UNI module
Hi.
I'm trying to communicate with a digital dail indicatior by RS232 communication. I'm a complete novice in seriel communications.
Device is having a data button, and when pressing this, the device is sending data and PLC is receiving the data. But by making the request by DTR signal from the PLC, I get no data from my device.
Using AXL_RSUNI_PD_2 functionblock in Engineer.
Details from the device:
Thanks in advance
Kim
Comments
Hi Kim,
That graphic is difficult to read at that resolution, but I am guessing that the dial indicator streams data continuously while it is getting the DTR signal from the RS UNI.
If you are already receiving serial data in your PLCnext Engineer program using the manual method (without DTR), then that is a great start.
Some things to check:
False = the DTR signal is set automatically when there is enough buffer space in the RS UNI to receive data (this is probably what you want).
True = you must set the DTR signal yourself in your code, by sending commands to the RS UNI.
Hopefully something here will help us find the solution.
~ Martin.
Hi Martin.
Thanks for the reply.
The dail indicator doen't stream data continuously.
Maybe this gives more information than the datasheet:
1) The MarCator 1086 WR is sending the measuring value (data output Txd) on PIN2.
2) To trigger the measuring data the PIN7 needs to be continuously on high-pegel (RTS).
3) To trigger the measuring data the PIN4 – DTR needs to be on high pegel and low pegel like described in the manual:
First High-Pegel
100 ms ≤ T1 ≤ 1000 ms à Low Pegel
(15 ms ≤ T2 ≤ 160 ms
35 ms ≤ T3 ≤ 40 ms)
300 ms ≤ T4 à High Pegel
Then repeat if another value should be send.
4) PIN3 needs to be constantly on LOW-Pegel.
Further information:
The definition of Vdd is a voltage between 3V and 15V.
I tried with a serial analyzer on my pc.: Here it works
Signal sent: DTR Turned OFF ...
Signal sent: DTR Turned ON ...
Data received: 045 048 048 054 046 050 057 049 013
Signal sent: DTR Turned OFF ...
Signal sent: DTR Turned ON ...
Signal sent: DTR Turned OFF ...
Signal sent: DTR Turned ON ...
Data received: 043 048 048 049 046 055 051 052 013
Signal sent: DTR Turned OFF ...
Signal sent: DTR Turned ON ...
Data received: 043 048 048 056 046 054 051 052 013
Signal sent: DTR Turned OFF ...
Signal sent: DTR Turned ON ...
Data received: 045 048 048 054 046 050 057 049 013
On the UNI module I have status in 33 (contant) and 22 (when xDTR is on) I'm a little unsure of the wiring on the module :-( but device Txd to Rxd and opposite. pin4 and 7 I'm not sure about. If I put 4 in CTS(13) and pin7 in DTR(22) if pin7 is loose and i just put it shortly in DTR, i get a data signal to my device, and can read data in the PLC, if manipulated correctly.
Best regards
Kim
Hi Kim,
Thanks for the additional information.
I need to correct a mistake in my earlier answer - the xDTR parameter on the function block instance controls the DTR output on the RS UNI, but only when the corresponding mode is selected in the RS UNI configuration page in PLCnext Engineer.
So, my description of the xDTR parameter on the function block instance should have been:
False = the DTR signal is set.
True = the DTR signal is reset.
... but only when the RS UNI has been configured with "DTR Controlled by process data" in PLCnext Engineer, as shown below:
Can you please let us know what settings you have on this page in PLCnext Engineer?
~ Martin.
Hi Martin
My settings on the RSUNI is:
interface: RS232
Tv: 255
Tn: 150
DTR control: controlled by process data
Protocol: transparant
Baud: 4800
Data width: 7Dbits, even, 2 stops
1st.: 13
2.: 10
Data exchange: via process data.
When I set xDTR true the DTR(22) doesn't go low on the module.
Image of device pin config and timing chart.
Pin2 Txd to Rxd on RSUNI
Pin3 Rxd to Txd on RSUNI
Pin4 to (DTR on RSUNI?)
Pin7 to (RTS on RSUNI?)
Best regards
Kim
OK, so it looks like pin 4 should be wired to O22, and pin 7 to O13:
When you toggle the xDTR input on the AXL_RSUNI_PD_2 function block instance, do you see the orange LED on O22 going on (xDTR=TRUE) and off (xDTR=FALSE) on the RS UNI module?
If not, that would be strange ... with those configuration settings, I would expect the O22 output to mirror the xDTR input on the function block. If this does not happen, I will need to check with the developers of the RS UNI module.
~ Martin.
Hi Martin
LED(22) is constant on when switching xDTR true/false. Even if AXL_RSUNI_PD_2 function block is FALSE on xActivate.
I can share my project if needed, as well for datasheet of device.
I thought it would be simple, as testing on Pc with a rs232 analyzer works with no problems.
Thank you for your effort so far :-)
~Kim
Yes, we may need to look at the PLCnext Engineer project.
If it OK with you I will ask someone to contact you by email, using the address that you used to register on this forum.
Hi Martin
This is ok with me. looking forward to hear from someone :-)
Have a nice day, and thanks :-)
I haven't heard from anyone at Phoenix.
The DTR led(22) is working now, when active/deavtivate xDTR on the block. Maybe settings hasn't been written prober to the project/module? But is still not recieving any data.
In my 232Analyzer on the pc it works, when having RST and DTR active. toggling DTR off and back on, I recieve the data as intended. please see attached screendump.
My big question is(i quess, maybe solves my problem): how do i turn on RST on the module?
~Kim
I'm really sorry that no one has contacted you. I will follow this up internally.
To your question:
Have you tried wiring RTS on the dial indicator to the CTS input (13) on the RS UNI module?
~ Martin.
Yes I have tried connecting RTS to CTS, with no result. CTS is not active on the module.
A strange thing, that we just should forget about, is that DTR started working after I tried with another RSUNI module HW/FW:01/100. I just wanted to exclude the case of a mailfunction in the module. I'm back on a HW/FW:02/102 module
(as a complete PLC-next enineer novice, I do make mistakes:) )
And, when you connect this output to the CTS input (13) on the RS UNI module, the LED does not light up on the RS UNI module?
I think we need to supply +Vdd to the CTS input in the RS UNI, which I was hoping would come from the Dial Indicator. But if not, we will need to try something else.
On the DTR issue: If I understand correctly, this issue is solved. If I have misunderstood, please let us know.
~ Martin.
first: DTR issue is solved.
I read it as the +Vdd should come from the module by the RTS output to the dail indicator. When i simulate on the PC I turn on the RTS output, and then toggle DTR to recieve data. This way it works.
The only information about the RTS in the RSUNI manual uses Tv and Tn to set RTS high? I quess I would like it to be high when PD block is activated
~Kim
If you have the dial indicator powered up, and all the pins on the dial indicator are disconnected, what voltage do you measure on the dial indicator between
- pin 7 (+) and pin 3 ? I expect something in the range +10 VDC to +30 VDC.
- pin 7 (+) and GND (or 0VDC on the PSU) ? I expect something in the range +5 VDC to +15 VDC.
If this is the case, then connecting pin 7 on the dial indicator to the CTS (13) input on the RS UNI module should illuminate LED 13 on the RS UNI.
- pin 7 (+) and pin 3 ? I expect something in the range +10 VDC to +30 VDC. - I got 0VDC here
- pin 7 (+) and GND (or 0VDC on the PSU) ? I expect something in the range +5 VDC to +15 VDC. - I got 0VDC here as weel
for info the dial indicator is powered by a CR 2450, 3V battery, and need RS232 supply from the module
Is it "just" putting pin7(RTS) to 24VDC ?
It appears that +Vdd must be a constant voltage between +5 VDC and +15 VDC. This is also what is required for the CTS input (13) on the RS UNI module. Since you will be toggling the DTR output on the RS UNI, I cannot see any other suitable output on the RS UNI module that can provide this constant voltage signal.
I will need to check with the support team for the RS UNI module, and let you know.
There's a first for everything:D Looking forward to hear from you.
If possible please contact me by email, as I dont recieve notifications from this forum.
I have a Step-ps/1AC/5DC/2 (232013) in case I need a seperate power supply for this system setup.
Can you please try sending a message - any message - from the PLC to the RS UNI module using the AXL_RSUNI_PD function block, with the Timeout disabled (i.e. set to T#0ms).
I suspect that this will set the RTS output (12) on the RS UNI, and this will stay on forever if the CTS input (13) is never set high - so CTS should be left disconnected. If this is the case, then this will give you the +Vdd signal that you need for pin 7 on the indicator. The message you are trying to send will then stay in the output buffer of the RS UNI forever, which will keep RTS high.
Please let us know if this works.
RTS is active constant now. send lenght has to be 0 otherwise the module goes busy.
I get data from the dial indicator, and just need to work a little on the timing toggling the DTR signal.
THANK YOU