DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

RS 232 Communication DIAdem Serial Monitor

Hello everyone,

I want to send/receive data to a device which is connected to my computer (RS232 / with USB converter).
The device is a SSI to Analog/Serial converter (Motrona iv251).

Send/receive data to the device with OEM Software application (Os 60 by Motrona) is possible.
The device is connected to Com4 ( 9600 / 7 / 1 / even). Parameter settings can be up and downloaded and the actual position value
of the Sensor which is connected by SSI to the device.


I want receive the sensor position with the DIAdem Serial Monitor.
Settings in Diadem are matching to the settings in the device (Com 4 / Baud rate 9600 / No. of data bits 7 /stop bits 1 / even).

In the serial monitor Com4 is selected.

According to the User Manual the device communicates via "LECOM- Standard" (DIN ISO 1754).

The Device needs a request for Data:
EOT (Hex04), AD1 (Unit adress, high byte), AD2 (Unit adress, low byte), C1 (Register code, high byte), C2 (register code, low byte), ENQ = Control Character Ctrl (Hex05)

The Adress of the Unit is 11 (default setting/also available or visible in the OEM-Application). The Position is written in the Register ":8".
According to the Manual the device needs the String: EOT AD1 AD2 C1 C2 ENQ. With the Adress 11 and the Position the String should be "EOT 1 1 : 8 ENQ".

After that the device should bring back
"EOT 1 1 XXXX ETX BCC". (the XXXX is the Sensor position value).

After sending the request String EOT 1 1 : 8 ENQ (or 04 31 31 3A 38 05 in hex) I get no values back.

 

Is the sending request in the right data Type or does anyone of you see a Syntax error in the send message?

0 Kudos
Message 1 of 5
(3,259 Views)

Hello ChrisF,

if you want to send a character in hex format with the DIAdem Serial Monitor you can enter a "$" followed by the two digit hex value of the character. E.g. to send the "EOT" character, enter "$04" in the control to send data. If you want to send multiple hex values, enter these hex codes one after the other (without any blank characters between them).

You mention that the address of the sensor is "11" and that the manual of the sensor says that the address is a two byte value (in high byte - low byte order). So I guess that the correct address of your sensor is 0x000B. The same seems to apply to the register value which I think is 0x0008. I think the correct string to send to the sensor would be

"$04$00$0B:$00$08$05"

Hope that helps.

 

Regards

Rainer

0 Kudos
Message 2 of 5
(3,222 Views)

Hello RainerH,

 

yes it helps, thx.

"$" sign and without any blank Charakters between. The correct string is "$04$00$0B$0:$08$05".

But it does not work every time with the Serial monitor.

When the string is sended sometimes a value is sended back, sometimes not. Maybe Timing issue.

 

Anyway i have found a complete other solution. The motrona Card can be setted to "cycle mode" by  parameter setting. In that mode the

cards send within a cycle time ( can be setted as Parameter 1ms - 9999ms) constantly the sensor values.

 

Those values can be received in the DAC with a script block (VBS/ oUDIM.Read()). In the VBS File is no send/request string necessary with the

cycle mode parameter setting in the card.

0 Kudos
Message 3 of 5
(3,203 Views)

Hello Kris,

 

if you have used the DIAdem Script template for SFDU_ComInit(), the default  timeout value is very short:

Call oUDI.ParamSet("Timeout",10)

10 means: 10 milliseconds. Try a larger value.

0 Kudos
Message 4 of 5
(3,173 Views)

Hello Pieczarek,

 

the timing issue appears only in the serial monitor window (wich I used to test the communication with the device).

 

The Vb script I use works fine. I don't need the Serial Monitor because everything I wanted was reading out the values from the device. With the VB script and the script-block in DAC kit i can read the value with the number display and/or a trace monitor.

 

That means I found another Workaround on my own and the issue is solved.

 

but thanx for your tip anyway. Maybe if there are timeout issues in another applicationso. That can be a helpful and valuable Information.

0 Kudos
Message 5 of 5
(3,163 Views)