03-12-2021 01:42 AM
Hi Ryan,
@Ryan777 wrote:
I was wondering how do I connect it up to LabView to read the data that is produced?
Use the USB cable coming with your sensor and plug it into a free USB port of your computer…
(A virtual COM port (VCP) should appear.)
@Ryan777 wrote:
As for sending the commands to the encoder, how do I go about doing it?
Use VISA functions to send commands (VISAWrite) and read responses (VISARead) with that VCP…
What have you tried and where are you stuck?
03-12-2021 03:00 AM - edited 03-12-2021 03:01 AM
Hi GerdW,
I am relatively new to Labview but this was what I came up with but there is no output data from my end. Am I missing something? Your help would be greatly appreciated!
Thanks!
Regards,
Ryan
03-12-2021 03:50 AM - edited 03-12-2021 03:53 AM
Hi Ryan,
why do you wire "i" to the "number of bytes" input of VISARead? Use a numeric constant set to the expected number of bytes in the response of your device!
Where do you send the command (as described in your PDF) to your device?
Do you get any error message when stopping the VI?
Do you get any received string (before you convert the string to number)?
@Ryan777 wrote:
I am relatively new to Labview
Did you take the Training resources as offered in the header of the LabVIEW board?
03-14-2021 10:08 PM
Hi GerdW,
I have made adjustments based on your advice and these are the following results. I changed the block diagram and added in a VISAWrite.
I finally got some output data but the data looks like its the data for version request as shown below. (Data shown below is string data)
When I keyed in commands to view the data, nothing changes. Is my VISAWrite placed incorrectly? Thanks in advance!
Regards,
Ryan
03-15-2021 02:31 AM
Hi Ryan,
@Ryan777 wrote:
I finally got some output data but the data looks like its the data for version request as shown below. (Data shown below is string data) … Is my VISAWrite placed incorrectly?
The VISAWrite seems to be placed correctly.
The data shown in the image indeed looks like the respoonse to an identification command. Did you read the manual to learn how to parse that answer?
@Ryan777 wrote:
When I keyed in commands to view the data, nothing changes.
Did you type the commands exactly as is described in the manual?
Did you type the correct TermChars? Most devices don't answer until they receive the needed TermChar…
03-15-2021 03:07 AM
Hi GerdW,
I managed to get data readings by sending commands to the encoder. However, the data I am getting is in Hexadecimal as shown below. For the string conversion, I can't seem to find one that can output can data in decimal format. The following FAFB C000 corresponds to the the angle 352 and yes when I rotate the encoder, different Hexadecimals will be shown. Do you know how I can get my data in degree based on my given output?
Thank you.
Regards,
Ryan
I used a Hexadecimal string to Number function but no data is shown on the indicator.
03-15-2021 03:35 AM - edited 03-15-2021 03:35 AM
Hi Ryan,
did you read the manual?
Command "3" gives you the "absolute encoder position", described as
3 bytes binary absolute position, big-endian, left aligned
1 byte detailed encoder status
So you need to read 4 bytes and convert the first 3 bytes into an integer number:

"FAFBC0" results in a position of 16448448…
03-15-2021 04:40 AM
03-15-2021 06:37 AM
03-15-2021 09:37 PM
Hi GerdW,
Thanks for the help so far! Lets say if my Hexadecimal is "FAFBC000", how do I edit your block diagram so that the conversion involves the first 5 characters "FAFBC" instead of "FAFBC0"
So the final decimal output will be "1028028" instead of "16448448".
Thank you.
Regards,
Ryan