LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

laser sensor Labview program

Hi,

 

I tried to retrieve a data from a Optex laser sensor, CD22-35-RS485-M12.

I used a Rs-485 to USB converter link to my laptop.

It shows error when i run the program.

Attached a Labview program, error massage file, laser sensor user manual and cable connection for your reference.

 

Please use my Labview project file for amendment.

 

Thank you very much.

0 Kudos
Message 1 of 3
(883 Views)

Hi Jeffrey,

 


@Jeffrey_Oon wrote:

It shows error when i run the program.

Attached a Labview program, error massage file, laser sensor user manual and cable connection for your reference.


  • Did you verify the COM port settings? The error message says one or more of those settings isn't supported by your COM port (aka that USB-to-RS485 converter)…
  • Did you try to use different settings on your sensor device?
  • The strings sent to your device seem wrong to me: your device expects bytes (aka U8 datatype) instead of strings containing 2 ASCII chars for values like "02h"!
  • You should never use BytesAtPort! Instead you should read that 6 bytes of the device response! (Or set ETX as TermChar and read one more (BCC) byte…)
Best regards,
GerdW


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

The stop bit value is invalid: the right value is not 1 but 10.

I suggest to delete your constant and the conversion function, right-click the input terminal of the Configure vi and select Create --> Costant.

The same you can do with all other vi inputs. Conversion functions are not necessary.

All other suggestions from GerdW remain valid.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 3
(858 Views)