06-20-2016 04:05 AM
Hi,
I am presently evaluating a Lika Absolute Encoder. It has a SSI interface. It is connected to my PC via serial port.
Using its own utility software, i can communicate to the sensor. I want to create a simple VI of my own to communicate
to the sensor, read and process its output data to be used for my application. I have tried the example vi that comes
with the LabVIEW program but i cant seem to communicate with the sensor.
The configuration parameter of the serial port have fixed values as stated on its manual; baudrate: 9600, byte size: 8,
parity: none, stop bits: 1 and flow control:none.
Does anyone have experience for SSI interface and /or have any sample vi to share ? Any assistance I would greatly
appreciate. Thanks a lot!
Solved! Go to Solution.
06-15-2018 07:22 PM
Hi,
I was able to communicate to the sensor. I am getting string data, but cant seem to extract the position data that i need.
Example 1 at random position a.
String output is,
023A 392B 3335 3936 3530 0327
02 is the Start
3A 39 is the register number
2B 3335 3936 3530, position is 359650 or 359.650 degrees
03 is the end
27 is the block check character
Example 2 at random position b.
023A 392B 3134 3234 0328
02 is the Start
3A 39 is the register number
2B 3134 3234, position is 1424 or 1.424 degrees
03 is the end
28 is the block check character
Can anyone help me or teach me how to extract those position data from random string output. I would appreciate if you can refer me to any sample VI. Thanks a lot.
06-15-2018 10:45 PM
31 is the ascii code for 1
34 is the ascii code for 4
break those bytes out of the string. Is should look like "1424" in a normal string display. Do a convert string to decimal number then divide by 1000.
06-15-2018 11:34 PM
Hi,
Thank you for your kind reply.
Will this be correct (attached)?
First I changed to "\" code display, use the function "Match Pattern" and converted
string to decimal.
Thanks.
06-16-2018 08:01 AM
That looks like it what I was saying.
Does it work?
Note, changing to \display doesn't do anything except change the way the data appears to you. The underlying data on the wire is still the same.
06-16-2018 08:33 PM
Thanks a lot.
It works.
Yes, its true regardless of the display the result is the same. But with the current display,
i can find a "match" pattern "+" while on the hex i cant.
Thanks a lot Sir RavensFan.