Support Forums
Serial Sensor - Number Assignment

G'day Team,

Hope you can give me a quick pointer.
I have a serial scale sensor sending me back a weight in format "ST,GS 2.450kg"
So I am using the serial expression builder in an attempt to get the 2.45 out.

1SERIAL(RS232,"\eST,GS%f[5CV]kg")
Works like a charm getting me 2.5 (seems to round the decimal part up)

So I am trying a formatted float
1SERIAL(RS232,"\eST,GS%5.3f[5CV]kg")
in an attempt to get the full resolution but DT80 & DT800 are not accepting it, error:
"dataTaker 80 E115 - Serial sensor control string error at column 26 [ \eST,GS%5.<err>3f[5CV]kg' ]"

Do you have any advice?

PS - Yes I have checked that the device returns the higher resolution
1SERIAL(RS232,"\e%0s[1$]\e",=1CV,2) shows at least two decimal places
1$ ST,GS 2.250kg
1$ US,GS 2.650kg
1$ ST,GS 2.450kg
1$ ST,GS 2.400kg

Cheers again
Ben Harper

G&#039;day Team, Hope you can give me a quick pointer. I have a serial scale sensor sending me back a weight in format &quot;ST,GS 2.450kg&quot; So I am using the serial expression builder in an attempt to get the 2.45 out. 1SERIAL(RS232,&quot;\eST,GS%f[5CV]kg&quot;) Works like a charm getting me 2.5 (seems to round the decimal part up) So I am trying a formatted float 1SERIAL(RS232,&quot;\eST,GS%5.3f[5CV]kg&quot;) in an attempt to get the full resolution but DT80 &amp; DT800 are not accepting it, error: &quot;dataTaker 80 E115 - Serial sensor control string error at column 26 [ \eST,GS%5.&lt;err&gt;3f[5CV]kg&#039; ]&quot; Do you have any advice? PS - Yes I have checked that the device returns the higher resolution 1SERIAL(RS232,&quot;\e%0s[1$]\e&quot;,=1CV,2) shows at least two decimal places 1$ ST,GS 2.250kg 1$ US,GS 2.650kg 1$ ST,GS 2.450kg 1$ ST,GS 2.400kg Cheers again Ben Harper

Good morning Ben,

Try adding the channel option FF3 to display 3 decimal places
e.g. 1SERIAL(RS232,"\eST,GS%f[5CV]kg",FF3)

Cheers

Roger

Good morning Ben, Try adding the channel option FF3 to display 3 decimal places e.g. 1SERIAL(RS232,&quot;\eST,GS%f[5CV]kg&quot;,FF3) Cheers Roger

Hi Roger,
Ill give that a try, thankyou.

May I also ask, how do I add the line "PS=9600,N,8,1,NOFC" into the DeLogger software.
I believe that once I saw a PS Type under the serial signal but it is not there, when programming form a terminal screen I can set this parameter however however not by the DeLogger software?

Hi Roger, Ill give that a try, thankyou. May I also ask, how do I add the line &quot;PS=9600,N,8,1,NOFC&quot; into the DeLogger software. I believe that once I saw a PS Type under the serial signal but it is not there, when programming form a terminal screen I can set this parameter however however not by the DeLogger software?

Good morning Ben,

You don't.
The PS command has been replaced by profile settings.

Cheers

Roger

Good morning Ben, You don&#039;t. The PS command has been replaced by profile settings. Cheers Roger

Ah yes, I can see for the DT80 its
[SERSEN_PORT]
*BPS = 9600
DATA_BITS = 8
STOP_BITS = 1
PARITY = NONE
FLOW = NONE
MODE = RS232
FUNCTION = SERIAL
However what about the 800, it has much less in the profile?

One Last Q on the topic, I cant get negative values with this code from my strain gauge - 1SERIAL(RS232,"\eUS,GS%f[5CV]kg,.1")
The serial data coming back can see the neg values, but the DT doesnt get the negative value into 5CV value from data such as below
US,GS- 6.400kg
US,GS- 6.650kg

Ah yes, I can see for the DT80 its [SERSEN_PORT] *BPS = 9600 DATA_BITS = 8 STOP_BITS = 1 PARITY = NONE FLOW = NONE MODE = RS232 FUNCTION = SERIAL However what about the 800, it has much less in the profile? One Last Q on the topic, I cant get negative values with this code from my strain gauge - 1SERIAL(RS232,&quot;\eUS,GS%f[5CV]kg,.1&quot;) The serial data coming back can see the neg values, but the DT doesnt get the negative value into 5CV value from data such as below US,GS- 6.400kg US,GS- 6.650kg

Not quite there!!!

The Sample Serial Data: ST,GS- 0.250kg
As the '-' is not butted up against the 0.250 I am unable to get it to assign a CV with the negative value

So I tried: 1SERIAL(RS232,"\eST,GS%1s[1$]%d[5CV]%*s")
And I can get the '-' to appear in a text channel 1$, with the 0.250 appearing in 5CV.
I had hoped to say something along the lines of if 1$='-' then 5CV=0-5CV but it doesn't appear that the n$ variables can be used in the CV calculation area.

Am I on the right track or is there a simpler way?

Not quite there!!! The Sample Serial Data: ST,GS- 0.250kg As the &#039;-&#039; is not butted up against the 0.250 I am unable to get it to assign a CV with the negative value So I tried: 1SERIAL(RS232,&quot;\eST,GS%1s[1$]%d[5CV]%*s&quot;) And I can get the &#039;-&#039; to appear in a text channel 1$, with the 0.250 appearing in 5CV. I had hoped to say something along the lines of if 1$=&#039;-&#039; then 5CV=0-5CV but it doesn&#039;t appear that the n$ variables can be used in the CV calculation area. Am I on the right track or is there a simpler way?

Good morning Ben,

You could try doing a matching to "One of a set"
For example:
1SERIAL(RS232,"\eST,GS%1s[' ','-',10CV]%d[5CV]%*s")

the %1s[' ','-',10CV] means
%1s - Read 1 character as a string
' ' - If the string matches a space then 10CV=0
"-" - If the string matches a - then 10CV=1

Then use an alarm to check to see if 10CV is equal to 1 and multiply 5CV x -1
Cheers

Roger

Good morning Ben, You could try doing a matching to &quot;One of a set&quot; For example: 1SERIAL(RS232,&quot;\eST,GS%1s[&#039; &#039;,&#039;-&#039;,10CV]%d[5CV]%*s&quot;) the %1s[&#039; &#039;,&#039;-&#039;,10CV] means %1s - Read 1 character as a string &#039; &#039; - If the string matches a space then 10CV=0 &quot;-&quot; - If the string matches a - then 10CV=1 Then use an alarm to check to see if 10CV is equal to 1 and multiply 5CV x -1 Cheers Roger

Thanks Roger,
I am trying that now, however my alarms action process seems to run regardless of whether the condition is true.

A simple test shows very odd results

1CV=-1.0
IF(1CV>-2)"YES greater than -2"{[1CV=5]}
1CV 5.0
A False Condition, so the "YES greater than -2" text is not echo'd but the 1CV=5 is still executed?

1CV=3.0
IF(1CV>1.0)"YES greater than 1.0"{[1CV=5]}
YES greater than 1.0
1CV 5.0

A True Condition, so the YES greater than 1.0" text is and the 1CV=5 is executed?

So it doesn't seem to matter if the condition evaluates to true or false, the action process is always executed?
Surely not but I have read and re read the alarm documentation and cannot see why this is happening

Thanks Roger, I am trying that now, however my alarms action process seems to run regardless of whether the condition is true. A simple test shows very odd results 1CV=-1.0 IF(1CV&gt;-2)&quot;YES greater than -2&quot;{[1CV=5]} 1CV 5.0 A False Condition, so the &quot;YES greater than -2&quot; text is not echo&#039;d but the 1CV=5 is still executed? 1CV=3.0 IF(1CV&gt;1.0)&quot;YES greater than 1.0&quot;{[1CV=5]} YES greater than 1.0 1CV 5.0 A True Condition, so the YES greater than 1.0&quot; text is and the 1CV=5 is executed? So it doesn&#039;t seem to matter if the condition evaluates to true or false, the action process is always executed? Surely not but I have read and re read the alarm documentation and cannot see why this is happening

OOPS! Correct Test Below

1CV=-1.0
IF(1CV>0)"YES greater than 0 "{[1CV=5]}
1CV 5.0
A False Condition, so the "YES greater than 0" text is not echo'd but the 1CV=5 is still executed?

1CV=3.0
IF(1CV>1.0)"YES greater than 1.0"{[1CV=5]}
YES greater than 1.0
1CV 5.0
A True Condition, so the YES greater than 1.0" text is and the 1CV=5 is executed?

So it doesn't seem to matter if the condition evaluates to true or false, the action process is always executed?
Surely not but I have read and re read the alarm documentation and cannot see why this is happening

OOPS! Correct Test Below 1CV=-1.0 IF(1CV&gt;0)&quot;YES greater than 0 &quot;{[1CV=5]} 1CV 5.0 A False Condition, so the &quot;YES greater than 0&quot; text is not echo&#039;d but the 1CV=5 is still executed? 1CV=3.0 IF(1CV&gt;1.0)&quot;YES greater than 1.0&quot;{[1CV=5]} YES greater than 1.0 1CV 5.0 A True Condition, so the YES greater than 1.0&quot; text is and the 1CV=5 is executed? So it doesn&#039;t seem to matter if the condition evaluates to true or false, the action process is always executed? Surely not but I have read and re read the alarm documentation and cannot see why this is happening

Ahh,
It seems the alarms dont work outside a job!!!

My Short Job seems to be working,
BEGIN"JOB1"
PS=9600,N,8,1,NOFC
5CV("Load~KG")
RA1S
1SERIAL(RS232,"\e\w[100]\p\e")
1SERIAL(RS232,"\eGS%1s[' ','-',10CV]%f[11CV]%*s",FF3)
IF(10CV>0.5){[5CV=0-11CV]}
IF(10CV<0.5){[5CV=11CV]}
5CV("Load~KG")
END

The weights are still being rounded but it seems to be a limitation in CV's
If I set 9CV=1.025. The Logger returns to me 9CV 1.0

Ahh, It seems the alarms dont work outside a job!!! My Short Job seems to be working, BEGIN&quot;JOB1&quot; PS=9600,N,8,1,NOFC 5CV(&quot;Load~KG&quot;) RA1S 1SERIAL(RS232,&quot;\e\w[100]\p\e&quot;) 1SERIAL(RS232,&quot;\eGS%1s[&#039; &#039;,&#039;-&#039;,10CV]%f[11CV]%*s&quot;,FF3) IF(10CV&gt;0.5){[5CV=0-11CV]} IF(10CV&lt;0.5){[5CV=11CV]} 5CV(&quot;Load~KG&quot;) END The weights are still being rounded but it seems to be a limitation in CV&#039;s If I set 9CV=1.025. The Logger returns to me 9CV 1.0

Found That as well!

5CV("Load~KG",FF3)=(11CV(10CV<.5))+(0-11CV(10CV>.5)) - Shows Me the correct dec places.

Right - Roger - Thanks again for your great support and fantastic products.
Ben

Found That as well! 5CV(&quot;Load~KG&quot;,FF3)=(11CV*(10CV&lt;.5))+(0-11CV*(10CV&gt;.5)) - Shows Me the correct dec places. Right - Roger - Thanks again for your great support and fantastic products. Ben

Hi Ben,

Use the FF channel option to set the number of decimal places

e.g. 1CV(ff6) will give you six decimal places.

Cheers

Roger

Hi Ben, Use the FF channel option to set the number of decimal places e.g. 1CV(ff6) will give you six decimal places. Cheers Roger
50
11
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft