Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

The Communication between LabVIEW and MCU based on Modbus Protocol

Solved!
Go to solution

hi,

   i'm a freshman in the applications of serial port.and you see,my projiect needs communicate between LV and MCU based on Modbus Protocol.all the configures are correct,but the lv send the wrong information that is'nt suitable for modbus.i don't know how to fix it.

my programs are as follows:

Download All
0 Kudos
Message 1 of 8
(5,220 Views)

and these are the additional.thanks a lot.

Download All
0 Kudos
Message 2 of 8
(5,219 Views)
Solution
Accepted by topic author kuailedjs

Why did you decide to create your own code instead of what is already available? If you had done a search, you would have easily found the modbus library. Give that a try.

Message 3 of 8
(5,211 Views)

what?labview has its own library?oh my god.thank you very much,i'll try again.

0 Kudos
Message 4 of 8
(5,198 Views)

hi,it's still me.follow your advices,i install the modbus library to labview,and i find it in the function pannel.you see,my purpose is that communicate between pc and mcu,yeah it's a communication software.and now the new question occus,need i use VISA write\read\closed?all the modbus library offers control or read coils,how can i program.

and did you do something like that?thanks a lot.

0 Kudos
Message 5 of 8
(5,191 Views)
The modbus library does use VISA, you don't need any other functions, and you can read or write anything you want - not just coils. Look at the subVIs that the examples use.
0 Kudos
Message 6 of 8
(5,187 Views)

thanks a lot.

0 Kudos
Message 7 of 8
(5,184 Views)

sir,it's still me.follow your advise,i download the library.and succeed to setup in my labview.

recently i try to use the library to program what i wanna.but the new problems happened to me.

i use the highlight to guard the date flow.everytime the flow came into the MB serial receive.vi correctly,and came out with the error-1073807253.i''m absolutely sure that all the parameter i set are correct.

the serial port is communicate via RS-485/232.the communication protocol is based on modbus protocol.

as a newbie,i'm confused long time.any advise is appreciated.

thank you for your help.

that's my program based on modbus library.

0 Kudos
Message 8 of 8
(5,118 Views)