DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 data format

Solved!
Go to solution

Its a good formula, good idea. Thanks.

(Now I have version 12.00.01. I have to check how much the conversion to version 13 cost.)

0 Kudos
Message 11 of 19
(4,032 Views)

It is a pity, but the system doesn’t work 100% correctly. Now I have four channels in RS232 input module throw them I catch string into four global string (11, 12, 13 and 21). The measurement data format is always “1x $xx\03”  (xx number of string). The needed data I extract from this strings. All is correct only when I received the data. But when I send some command throw output RS232module the answer wedges between strings and some strings are corrupted.

There are two examples. The first switch on the equipment, the second switch off the equipment.

(No correction - correct value at correct string, underlined – correct value at wrong string, cross out– extra or corrupted string)

Example 1:

STR_11=00S228.4MH STR_12=00S29.25 STR_13=00SI0.000W1.093ML STR_21=00S0.940ML

STR_11=00S228.4MH STR_12=00S29.25 STR_13=00SI0.000W1.093ML STR_21=00S0.940ML

STR_11=00S228.4MH STR_12=00S29.25 STR_13=00SI0.000W1.093ML STR_21=00S0.940ML

STR_11=00S228.4MH STR_12=00W STR_13=00W29.25 STR_21=00WI0.000W1.093ML

STR_11=00S228.4MH STR_12=00W STR_13=00W29.25 STR_21=00WI0.000W1.093ML

STR_11=00W0.940ML STR_12=00W228.4MH STR_13=00W29.25 STR_21=WI0.000W1.152ML00W0.940ML

STR_11=00W0.940ML STR_12=00W228.4MH STR_13=00W29.25 STR_21=WI0.000W1.152ML00W0.940ML

STR_11=00W0.940ML STR_12=00W228.4MH STR_13=00W29.25 STR_21=WI0.000W1.152ML00W0.940ML

STR_11=00W228.4MH STR_12=00W29.25 STR_13=00WI0.000W1.218ML STR_21=00W0.940ML

STR_11=00W228.4MH STR_12=00W29.25 STR_13=00WI0.000W1.218ML STR_21=00W0.940ML

STR_11=00W228.4MH STR_12=00W29.25 STR_13=00WI0.000W1.218ML STR_21=00W0.940ML

 

Example 2:

STR_11=00W228.4MH STR_12=00W29.25 STR_13=00WI0.000W1.281ML STR_21=00W0.940ML

STR_11=00W228.4MH STR_12=00W29.25 STR_13=00WI0.000W1.281ML STR_21=00W0.940ML

STR_11=00W228.4MH STR_12=00W29.25 STR_13=00WI0.000W1.281ML STR_21=00W0.940ML

STR_11=00P STR_12=00W29.25 STR_13=00WI0.000W1.281ML STR_21=00W0.940ML

STR_11=00P STR_12=00S STR_13=228.4MH STR_21=9.25

STR_11=00P STR_12=00S STR_13=228.4MH STR_21=9.25

STR_11=00S0.940ML STR_12=8.4MH STR_13=9.25 STR_21=SI0.000W1.289ML00S0.940ML

STR_11=00S0.940ML STR_12=8.4MH STR_13=9.25 STR_21=SI0.000W1.289ML00S0.940ML

STR_11=00S0.940ML STR_12=8.4MH STR_13=9.25 STR_21=SI0.000W1.289ML00S0.940ML

0 Kudos
Message 12 of 19
(4,015 Views)

What happens is that the RS232 Output command elicits a response.

You want to skip over that response.

 

In the OUTPUT command, you need to tell it how many characters to wait for and to ignore using \#m where m is a number from 1 to 999.

 

Waiting for device response     \# m 1<m<999
m = number of characters to skip
Waits after sending for the response sign of the external device. During the waiting period no other measurement device can access the serial interface. As soon as the response arrives, DASYLab enables the interface.
The m parameter specifies the number of characters that DASYLab skips at the beginning of a response string. 
Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 13 of 19
(4,010 Views)

I understand that the problem is due to the response of output command. I would like to skip over the response but I cannot find the correct way.

 

When I use the monitor at input module I obtain:

RUN\r

<STX>00I<ETX>

RAT\r

<STX>00I3.800MH<ETX>

 

Whole yesterday I tested to find the correct solution with complex sheet but without success. Now I have prepared as most as possible the simplest communication model with only one channel to test and arrange the correct communication. (I have enclosed it.)

I used the strings: STR10 - string at output module, STR11 - string at input module.

 

The string “#number” has no influence to result:

send string

STR10=RUN\r\#1

STR10=RUN\r\#3

STR10=RUN\r\#5

STR10=RUN\r\#9

received strings

STR11=00I

STR11=00I12.80MH

STR11=00I

STR11=00I12.80MH

STR11=00I

STR11=00I12.80MH

STR11=00I

STR11=00I12.80MH

 

 

 

 

 

send string

STR10=STP\r\#1

STR10=STP\r\#3

STR10=STP\r\#5

STR10=STP\r\#9

received strings

STR11=00P

STR11=00P12.80MH

STR11=00P

STR11=00P12.80MH

STR11=00P

STR11=00P12.80MH

STR11=00P

STR11=00P12.80MH


I have two questions: First - do you anybody have any idea how to fix it? Second Is there some possibility not to skip over the response, but put the response to some string?

0 Kudos
Message 14 of 19
(3,992 Views)

in the RS232 Output command, at the end of the command, add the command to skip

 

For example

 

RUN\r\#5

 

will skip over the response.

 

RAT\r\#11x

 

will skipp over that response.

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 15 of 19
(3,988 Views)

 

Warning: Shameless plug alert


 

 

Having said all this, I think that you should look at DASYLab 13.

 

We have a new Script module that would allow you to write your own "driver" for the pump.

 

I can help you with that if you like. I found another device with complex programming had a set of ActiveX COM objects that I could program to. It made working with it much easier.

 

If you simply have to work with com port, then there are a variety of Python examples on the web that can be a starting point.

 

www.dasylab.com

 

 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 16 of 19
(3,986 Views)

You can see at my previous question - I tested skip over the response with \#5 and also with \#1 and \#3 and so on, but the response is all time the same. I don’t know where a silly mistake is... Due to this, I try to simplify it and send you the simple sheet.

I ask for price of upgrade to new version - version 13, but the upgrade to this new one form version 12 cost 20% of this half year old version. It is pretty much. We haven’t used it yet. Now I have started I try to learn work with it ... I am not sure, that my boss will agree to buy it.

Today I am going to my holiday I will try to find the solution when I come back.

0 Kudos
Message 17 of 19
(3,970 Views)

I think there's a problem with the sending commands as strings... it's sending the \#1 as part of the string, and the module isn't using it.

 

Because of the variable length command, you may need multiple output channels configured...

 

[a]\#11 for example.

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 18 of 19
(3,964 Views)

Thank you. Yes it was necessary not to add \#1 as part of the string and put it to format field. It started to work, but of course 😉 again not correctly - because the sometimes, after sending the same string, the received string has different length.

Due to this, I completely rebuild the sheet. Now I only receive throw RS232 input. I sent everithing into one string and then I test the received string and found which one it is. Till now it works correctly 🙂

0 Kudos
Message 19 of 19
(3,908 Views)