12.6.5.4.1
Remove Total Result String
Finally if you do not want the total string anymore (
Total Result String
), this is mostly used
for debug purposes, you could simply remove it. Remove it from your UDT and find the
code snippet below in the function block and delete this snippet. It loops through the
whole string, waiting for the
<ETX>
character that determines the end of the string.
Since the string is looped through once again to parse all the variables it is a good idea
to remove this snippet if the time is critical.
//While we don't have <ETX>, save bytes to result string
//Saving the total result string is mostly for testing, this could
be removed to save time!
WHILE (BYTE_TO_CHAR(#arrData[#i]) <> '$03') DO
//Save every byte to the total result string
#s_total := CONCAT(IN1 := #s_total, IN2 :=
CHAR_TO_STRING(BYTE_TO_CHAR(#arrData[#i])));
#i := #i + 1;
END_WHILE;
#Data."Total Result String" := #s_total
//Start over and loop through incoming data again to cast every
single data type sent
#i := 6;
12.6.5.5
Increase the data array size
In the current function block the data received from the TriSpector1000 is saved in an
array of 100 bytes. If the string sent from the TriSpector1000 contains more than 100
bytes (characters) you need to extend this array. This is done by editing the data type in
the function block
FB_Trispector_Test
, shown in the image below.
After changing the size of the array you need to compile the data block corresponding to
this function block to get it updated as well. Right mouse click on the data block
FB_Trispector_Test_DB
->
Compile
->
Software (only changes)
.
APPENDIX
12
8021808/12ID/2019-01 | SICK
O P E R A T I N G I N S T R U C T I O N S | TriSpector1000
99
Subject to change without notice