LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SSI interface to PC serial port

Solved!
Go to solution

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!

 

0 Kudos
Message 1 of 6
(4,124 Views)

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.

0 Kudos
Message 2 of 6
(3,323 Views)
Solution
Accepted by topic author jtc

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.

0 Kudos
Message 3 of 6
(3,316 Views)

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.

0 Kudos
Message 4 of 6
(3,313 Views)

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.

0 Kudos
Message 5 of 6
(3,299 Views)

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.

0 Kudos
Message 6 of 6
(3,291 Views)