LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Absolute encoder

Thanks for the answer, but I just fixed that problem 🙂

So now I am able to send simple command to the encoder, and to get back its answer.

 

Only problem now is that sometimes I get a timeout error, even though the command is well executed and I got the right answer.

Any tips on how to fix that?

Message 11 of 20
(1,284 Views)

You can filter errors by error code…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 12 of 20
(1,278 Views)

Are you using the correct termination character when you configure the serial port?

 

Lynn said it looked like responses were terminated with a carriage return.  If you don't set that in the Serial configure, it will use the default of line feed.  Then you'd issue a command, and read some large number of bytes.  You'd get a complete message, but it will timeout because it won't get the linefeed character.  If you configure for carriage return, it won't timeout because the VISA read will return as soon as it sees the carriage return.

Message 13 of 20
(1,272 Views)

Hi Schindfj! You removed the standard program E201?

0 Kudos
Message 14 of 20
(1,139 Views)

You're not, by any chance, using "Bytes at port" AND termination enabled at the same time, are you?  It's one or the other (and in this case, termination is the way to go).

 

Of course everything is a guess because you are too shy to share your code.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 15 of 20
(1,111 Views)

I have the same problem, can you share your code? Thank you!

0 Kudos
Message 16 of 20
(696 Views)

Can you explain this further? Using the NI example serial communication VI I was able to send and receive basic commands but I do get errors between the response messages in addition to experiencing those time out errors.

 

The hex data I get from the current location command does not update as I move the encoder, it just has the same hex value regardless of the location. For example for command !, it always returns 1074006152: 3674488226 regardless of location. 

 

MetaMgmt_0-1707758563981.png

Looking at the datasheet for the encoder it says that the termination character is CR which is 0xd as opposed to 0xA, as it is in LabVIEW. 

0 Kudos
Message 17 of 20
(224 Views)

Hi Meta,

 


@MetaMgmt wrote:

Can you explain this further? 


You know you are asking in an old thread with several messages: who is "you"?

 


@MetaMgmt wrote:

Using the NI example serial communication VI I was able to send and receive basic commands but I do get errors between the response messages in addition to experiencing those time out errors. 


Those "ERROR" responses are just that: responses of your device. Read its manual to learn how to prevent such responses!

 


@MetaMgmt wrote:

Looking at the datasheet for the encoder it says that the termination character is CR which is 0xd as opposed to 0xA, as it is in LabVIEW. 


You forgot to mention the type of your encoder and to attach the datasheet…

How should we help when you don't provide minimal information?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 18 of 20
(217 Views)

Hello GerdW,

 

Thank you for your quick reply. Noted! I have attached the datasheet. 

0 Kudos
Message 19 of 20
(207 Views)

Hi Meta,

 

the command "n" is used to turn ON the encoder. How often do you want to turn the encoder on?

 

As I didn't see any mentioning of this "ERROR" response you should call the Renishaw support and ask for more information or a better programming manual. (As far as I know Renishaw support is quite good.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 20 of 20
(200 Views)