LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RLS encoder slow down while loop execution

Hello everyone,

 I have an absolute encoder RLS with E201 USB encoder interface, it uses Biss protocol, 24 bits.

From the small software that the company provided the position can be read very fast but when I try to read the data in Labview the While loop execution getting

slower than normal and shows the counts with a delay of 3 to 4 seconds. The code is simple and just has the I/O for Write and Read. Would you please advise if there is any way to get the data in a real-time or increase the reading response time? 

Thanks in advance

ENC1.jpg

 

0 Kudos
Message 1 of 33
(7,214 Views)

Hi Samamiri,

 

because of those controls/indicators missing their labels LabVIEW doesn't know how to handle the data from your sensor… (Just joking!)

 

What kind of protocol does your device use?

Why don't you use VISASerialPortConfig to set all needed parameters for the serial communication, including the TermChar?

Does your device use any TermChars? If yes: which one?

Do you need to send that "?" command in each iteration?

Do you need to bang the serial bus as fast as possible?

(And last, but not least: Why don't you use AutoCleanup before posting your code?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 33
(7,201 Views)

Are you sure the nr of bytes to read is correct? If you read more than is returned, the read will time out. You're clearing the error, so that is a bit suspicious.

 

Other than that, everything should be in the manual. Perhaps you need to send "?\n"? If so, you can configure visa to use end termination characters.

 

You'd usually know the exact nr of bytes to read, OR have a end termination character. If you don't have one of the two options, you get problems you're running into.

 

Alternative (if you don't have a termination character or know the nr of bytes) is to read bytes one by one until the result matches your expectations. This usually gets ugly...

0 Kudos
Message 3 of 33
(7,198 Views)

Thanks GerdW,

Your questions help me to solve the problem.

I used VISASerialPortConfig and just set the timeout option!!

Cheers

0 Kudos
Message 4 of 33
(7,184 Views)

Thanks for your notes, I will consider them.

In the user manual mentioned no need any end termination characters! and simple "?" works correctly.

0 Kudos
Message 5 of 33
(7,167 Views)

A shortened timeout is just a hack, it doesn't fix the real problem. You want the TO as sort as possible, making the read as fast as possible, but long enough to not cause any problems. What is a short enough timeout? Are you sure that it's never too short? What if windows or the device has a hiccup?

 

I'd dig into it a bit deeper. At least try to solve the problem without timeouts (or even worse: a Wait (ms) ). I like my drivers really good, as they are the building blocks of my application.

0 Kudos
Message 6 of 33
(7,163 Views)

I know this is a year old, but I'm writing this for myself when I forget and search for this again in a few years. This doesn't want a termchar on writes (that'll mess stuff up) but *does* want a termchar on reads. \r specifically. 

 

Also, "?" doesn't work on BiSS, just the SSI. on BiSS, you have to use the command "4" and parse the return as per page 2 of the attached document. Pay attention to the number of bits that you expect (word width) or you accidentally turn your status and or CRC bits into multipliers. you can check the word width with "b".

Message 7 of 33
(6,641 Views)

Hi, Samamiri,

 

I faced same problem as you.

Other than RLS E201 USB Encoder interface, what else did you use to connect it to Labview ?

Alternatively, can you post you latest Labview layout that used to solve your problem. 

 

Anybody know what interface need to use for link up RLS E201 USB Encoder interface and Labview ?

 

best regards.

 

0 Kudos
Message 8 of 33
(6,484 Views)

Hi Jeffrey,

 


@Jeffrey_Oon wrote:

Anybody know what interface need to use for link up RLS E201 USB Encoder interface and Labview ?


Did you read the PDF in the previous message?

Just the first sentence says it all:

The E201-9S interrogates a BiSS-C encoder and allows the data to be read by a PC using simple ASCII commands over a USB connection and a virtual COM port.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 33
(6,460 Views)

Hi GerdW,

 

My encoder is currently the same kind of encoder but it comes with a USB connection.

I was wondering how do I connect it up to LabView to read the data that is produced?

As for sending the commands to the encoder, how do I go about doing it? 

 

Thanks!

0 Kudos
Message 10 of 33
(6,456 Views)