Jump to content
News about the LabVIEW Wiki! Read more... ×
Porter

[LVTN] Plasmionique Modbus Master

Recommended Posts

18 hours ago, Porter said:

For #3, check the "MB_Master Simple Serial.vi" example located in "<LabVIEW>\examples\Plasmionique\MB Master\" or search for it in the Example Finder.

Thanks a lot.

I am gonna check what you said and I will post here the solution if I fix it.

Thanks again.

Share this post


Link to post
Share on other sites
On 2/2/2017 at 5:57 PM, Porter said:

For #3, check the "MB_Master Simple Serial.vi" example located in "<LabVIEW>\examples\Plasmionique\MB Master\" or search for it in the Example Finder.

Yes! That simple!! Thanks!!

I have another question.

In my application I have to read constantly a few variables from PLC (coils, registers...). For example if a coil is 1, then an event occurs in my application (in an event structure).

Sometimes as I said in #1 some variables are not read.

So what is the best way to do a poll? Just one while reading every variables (coils and registers) each 10ms for example and then pass the information in local variables to anothers whiles?

Thanks a lot!

Share this post


Link to post
Share on other sites

10ms seems like a very short polling period for a serial device. 100ms is more realistic. Of course it depends on baud rate, number of transactions, FIFO buffer settings etc... But yes, you can just poll the PLC in one loop (as shown in the simple serial example), then put the data into a queue or user event to pass it to other loops. I would recommend looking into the producer/consumer design pattern.

Share this post


Link to post
Share on other sites

Hi,

I am have a issue with this library. I will try to setup a modbus TCP Master and start communication with a slave device which uses a MBAP header. Is it possible to use this library for these application and how implementing it? Every try to start a communication stops with an error message :(

Many thanks in advance

Ingo    

Share this post


Link to post
Share on other sites

The Modbus TCP Master uses the MBAP header.

I will need more information in order to help you.

What error message is produced when communication stops?

Please post example code that reproduces the error.

Please try the attached code. Fill in the correct IP address, port number, slave ID, holding register address before running it. Post a screenshot of the output

MB TCP Read Holding Register Test.vi

Share this post


Link to post
Share on other sites

This project is now available on GitHub: https://github.com/rfporter/Modbus-Master

If you want to make modifications to the modbus master library, I suggest that you pull the source code from that repo.

To build your own release, you just need to build the "Source Distribution" then build a VIP package using "MB Master.vipb" with VI Package Manager 2014.

  • Like 1

Share this post


Link to post
Share on other sites

I was thinking, an useful addition to the cool Modbus Comm Tester would be a section for Read Device Identification. Probably fitting nicely the 7th rectangle on the FP is the difficult part of it; the extension of the code, which is elegantly written, seems trivial. What do you think about?

Edited by ensegre
  • Like 1

Share this post


Link to post
Share on other sites

A little bit more testing and tweaking is required. Almost ready for another release though.

Here is the preview: mb_master-1.3.2.7.vip

Transaction IDs are randomly generated.

Share this post


Link to post
Share on other sites

In version 1.3.2 the session valid property of the MB Master TCP class was broken. 

This is fixed in v1.3.3.

Share this post


Link to post
Share on other sites

Hopefully a real quick question:

I just started using this library, I got referred over here from the NI forums as this Modbus Library solved an issue that another MB library I was using had. That being said, I have not really taken a dive under the hood to figured out my problem. I was curious if anyone knew a quick fix before I started looking into it.

When I try to build an application through the application builder that is using this MB library I get an error telling me that it can't build a broken VI without attaching the block diagram (which does fix the issue). It pointed me towards the "Read Session Valid.vi" as the issue. When I looked at that vi I can see a broken arrow with the error pointing towards the "unbundle by name". Can anyone verify that this block diagram is correct? I double checked I had the newest version of the library and still get this issue.

 

Thanks!

MB Library.PNG

Share this post


Link to post
Share on other sites
5 hours ago, Masony said:

When I try to build an application through the application builder that is using this MB library I get an error telling me that it can't build a broken VI without attaching the block diagram (which does fix the issue). It pointed me towards the "Read Session Valid.vi" as the issue. When I looked at that vi I can see a broken arrow with the error pointing towards the "unbundle by name". Can anyone verify that this block diagram is correct? I double checked I had the newest version of the library and still get this issue.

This is fixed in the latest version (v1.3.3.1) here: 

 

Edited by Porter

Share this post


Link to post
Share on other sites

@Porter I'm trying to use Plasmionique Modbus ver 1.3.1.4 with Labview 2014 over serial and i keep running into a CRC error. it's not properly calculating the CRC.

For example:

The Master sends: 01 04 00 00 00 01 31 CA

and the builtin simple slave responds with 01 04 00 00 00 01 31 instead of the correct message 01 04 03 00 00 B9 30

i've this with the Plasmionique Master example and with the third party Modbus Poll program. and both report a CRC error.

Any help would be appriciated.

Share this post


Link to post
Share on other sites

Have you ever thought of creating a Slave Library? Your ablity to use visa locking to allow multiple masters to write over 1 comm port would be in valuable to doing the same to allow multiple slaves to read and write over the same serial port.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use.