LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

communicate with using RS485

Hi All,

 

I am trying to communicate with a device that use RS485 using Labview 2018.

i manage to control the device by using visa write. but I am not manage to get any respond by visa read. As I need to get the data from the device for data report.

is there any mistake on my source code?

 

thanks in advance!write and read load cell.png   

0 Kudos
Message 1 of 7
(2,000 Views)

As any other experienced LabVIEW user says, do not use bytes at the port, instead, if your device has some sort of termination character, let VISA take care of waiting for that termination character to appear.

 

Please share your RS485 device programming manual.

 

BTW, you've already sequenced the order of operations using error wires, no need for a flat sequence structure.

 

This is a good article to learn VISA usage - https://labviewwiki.org/wiki/VIWeek_2020/Proper_way_to_communicate_over_serial

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 7
(1,987 Views)

Also your Flat Sequence Structure is superfluous. 

 

In fact if you ever find yourself reach for a Sequence Structure, stop and think about it.

 

Chances are you do not need it at all and if you still think you do, come here and ask questions.

 

If this day and age the Sequence Structure (Flat or worse yet Stacked) should be deprecated and still available only for backwards compatibility with old code. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 7
(1,981 Views)

Thanks for your feedback,

 

can help to explain more on the termination character?

here i attached the manual of the device

0 Kudos
Message 4 of 7
(1,975 Views)

Oh my what a horrendous communication protocol. It seems somewhat Modbus like yet more convoluted...

 

What do these companies have against industry standards? Why must they reinvent the wheel?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 7
(1,957 Views)

Looks like somebody made a VI for another instrument from same manufacturer

 

https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Instrument-interface/td-p/2249024

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 6 of 7
(1,945 Views)

@RTSLVU wrote:

Oh my what a horrendous communication protocol. It seems somewhat Modbus like yet more convoluted...

 

What do these companies have against industry standards? Why must they reinvent the wheel?


I wouldn't call it horrendous. Complicated yes and very much on the barebone level of the microprocessor programming inside the device. Someone was using either a very constrained low power CPU with little memory available or porting a design from such a device to this hardware.

A SCPI interpreter is fairly complex to write and can take up more memory than what some 8 bit CPUs can allow, if you have a poor compiler to work with. This protocol can be implemented in a few kB of code even with a horrendously inefficient compiler.

 

Interfacing it from a C program is almost trivial if you just make the structures match to your specific C compiler. In LabVIEW it is only a little bit more complicated when you use the Flatten To String and Unflatten from String functions. In Python you need the ctypes library.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 7 of 7
(1,899 Views)