ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MODBUS RTU over Serial Port for Freescale microprocessor

 

I'm trying to communicate with a Freesacle Microprocessor MKL15Z32VFM4.

 

The protocol is using the TTL-UART port of the processor and MODBUS RTU, 19200, 8 data bits, 1 startBit, 1 stop bit, parity Even.

 

I have some string instructions to processor as "STATUS" or "DCLEVEL", and CRC bytes, etc. and of course I have to read the return,

 

Do any body makes this one before on Labview? 

I review the most of the MODBUS RTU post (and still reviewing), but I can't find anything than works.

 

Thank you!

0 Kudos
Message 1 of 6
(4,631 Views)

Luis,

I downloaded the NI-Modbus library, V1.2.1 zip file and was able to get the RS232 serial RTU demo to work with a Panasonic GT01 touchscreen. I'm using LabVIEW 2011.  I just had to following the installation instructions, and then ran the "MB Modbus Demo Box Example.vi" within the NI Modbus.llb.  This demo acts as a slave.

 

https://forums.ni.com/t5/Reference-Design-Content/LabVIEW-Modbus-API/ta-p/3524019

 

I'm customizing the demo for my application.  Once I get the slave application working, I plan to switch to a master so I can then replace the GT01 touchscreen with a PC for the purpose of automated testing.

 

I did have to customize the demo to get it to work. The demo doesn't pull out the baud rate as a control and defaults to 9600. I'm running at 38400, so I added a control for that purpose.

 

The difficulty with the RTU implementation is the 3.5 byte timing which typically will cause the baudrate generator to have a framing error. I've not dug into the details yet, but the library appears to address that issue.

 

0 Kudos
Message 2 of 6
(4,580 Views)

Thank You PointOne, I'll cotinue trying..

 

0 Kudos
Message 3 of 6
(4,560 Views)

I had to dig a bit into the modbus LabVIEW library. I modified the source, but it lets you see the details of the packet.

Useful when debugging.  Just recompile it for the version of LabVIEW that you are using.

 

 

 

 

0 Kudos
Message 4 of 6
(4,546 Views)

Hello Luis,

 

Thanks for using the NI forums! Please review the following examples from the LabVIEW DSC module:

 

  • Modbus Fundamentals.lvproj
  • Modbus Simulator.lvproj

You can find those examples in LabVIEW --> Help --> Find Examples...

 

But you will need to have installed the LabVIEW DSC module. Ileaveyouaswellsomeusefullinksinwhichyoucanfindotherusefulexamplesandinformation:

 

https://www.ni.com/en/shop/labview/introduction-to-modbus-using-labview.html

https://forums.ni.com/t5/LabVIEW/Need-help-with-Modbus-RTU-over-TCP-communication/td-p/1681618

 

Hope this information works for you!

 

 

Luis CT
0 Kudos
Message 5 of 6
(4,534 Views)

thank you all.

 

my project is working now.

 

 

0 Kudos
Message 6 of 6
(4,498 Views)