NI Labs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

NI LabVIEW Modbus API Discussion

Hi Smithd,

 

It looks like you left the Function Code stuff out of your Modbus API library on Version 1.2.1.42.

 

I had to manually go back and add this stuff back in the library.  Any Reason this was left out?

 

Edit....  I'm not sure what happened, possibly when I was using your example custom function code creation, I accidentally modified the Modbus Master.lvclass and put this dependency in earlier...


Also,  The latest version doesn't seem to run on the cRIO, so I went back 2 versions and now it works fine.

Ben Yeske
0 Kudos
Message 491 of 527
(3,947 Views)

Several years ago I tried unsuccessfully to use the previous version to communicate with one master and two slaves using serial protocol.  After several days of trying, was notified at that time that this was not possible.  Has this issue been resolved in the current version?  Now I am using an ActiveX library to do so (MBAXP) but need to connect another master to two clients using Modbus TCP.  Is it as simple as configuring separate IP's and using different ports in the same vi?

 

Thanks,

Chris

0 Kudos
Message 492 of 527
(3,862 Views)

This is my first time posting to a forum. I hope I'm putting this question in the right place.

 

I am trying to communicate with an Automation Direct SOLO temperature controller (SL4824-LR) through LabVIEW using the LabVIEW Modbus API. The controller is connected to the computer through an RS-485 cable to a USB adapter. The device is recognized by the computer (Windows 10) as a COM port. I'm using LabVIEW 2017. This device is set as master with device id=1 and protocol=ASCII.

 

I have successfully communicated with the device using the attached code. I can read multiple registers to get the process value (current temperature, register 4097) and set value (set temperature, register 4098). Register values are found in section 7-3 of this manual. However, when I try to write a single register, I get error 538184: "<APPEND>Function 6".

 

I only need to read the current temperature, and I only need to write the set temperature. If you have any tips, I will appreciate them.

 

Note: A NI technical support person suggested that I try changing a register that has a defined allowed range, so I tried writing and reading register 4120 (device decimal place). This is what was saved in my vi. I get the same error though when trying to write and read 4098. Also note that the register address is N-1, so if trying to write to 4098, I input 4097.

 

 

Solution:

Thanks to Porter for finding a step I missed in the manual for the device. As shown on page 3-20 of the SOLO manual, the CoSH parameter must be set to ON in order for the device to accept commands through RS485. It now successfully set the temperature!

0 Kudos
Message 493 of 527
(3,786 Views)

Not sure if it will help, but it looks like you are writing to register 4119 (not 4097) and reading from registers 4119 - 4127.  Is that what you intend to do?

Ben Yeske
0 Kudos
Message 494 of 527
(3,780 Views)

Thanks for your help Ben. I edited my original post with an explanation.

0 Kudos
Message 495 of 527
(3,773 Views)

I would suggest that you setup a master modbus and a slave modbus on two computers using similar LabVIEW code like you have, and see if you can get them to talk to each other.  Also check the computers Firewall to make sure the TCP/IP connection is allowed.

Ben Yeske
0 Kudos
Message 496 of 527
(3,767 Views)

See page 3-20 of the user manual. Make sure that on-line configuration is set to on.

 

I would also recommend that you try communicating with the temperature controller using their configuration software first:

https://support.automationdirect.com/products/solo.html

 

Then try with LabVIEW.

Message 497 of 527
(3,764 Views)

Also note that PV is address 4096 and setpoint is address 4097 (not 4098).

0 Kudos
Message 498 of 527
(3,761 Views)

Thanks Porter. You solved it. I revised my original post to show the solution. I just needed to turn the On-Line configuration. My apologies for missing that step in device setup, and many thanks for the suggestion!

0 Kudos
Message 499 of 527
(3,757 Views)

This is my first time using the forum I hope I put this in the correct spot.

I am looking for a download of Modbus. the version of LabVIEW I have is 2017 sp1 f3 

0 Kudos
Message 500 of 527
(3,319 Views)