LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI Modbus.llb, Labview 2010, VISA 5.0.0

Hello,

 

I rapidly developed a small application to test modbus communication between two PCs.
Serial and Ethernet. One PC Master and one PC Slave.


I find the examples of the library mgimodbus.zip which works fine and I modified them (MB Serial Example Slave.vi, MB Serial Example Master.vi, MB Ethernet Example Slave.vi, MB Ethernet Example Master.vi).


Configuration: Labview 6.1, VISA 2.6.1f2, mgimodbus.zip

 

I have upgraded Labview to 2009 then 2009 SP1 and now Labview 2010. But i keep Labview 6.1.

 

Configuration:
Labview 2010, nimodbus121 for 8.6
Labview 6.1, mgimodbus.zip
VISA 5.0.0

 

Now, with Labview 2010 in serial mode, my application, the examples of mgimodbus.zip and nimodbus121 for 8.6 does not work.
My application return an error in VISA Write.
Examples does not return any error.

 

I uninstalled VISA 5.0.0 installed with Labview 2010 and reinstalled VISA 2.6.1f2.
Now with Labview 6.1 my application is OK but not the examples of mgimodbus.zip in serial mode.

With Labview 2010 I cannot choose COM1.

 

I need help to run my application on Labview 2010.
Is the problem VISA?

0 Kudos
Message 1 of 10
(6,209 Views)

When you say something returns and error (such as VISA 5, LV 2010, and the VISA write), please tell us what the error # is.  That is the only way we are going to have a clue as to what is going wrong.

 

I'm sure you won't be able to get LV2010 working with VISA 2.6 because VISA 2.6 is just way too old.)

0 Kudos
Message 2 of 10
(6,182 Views)

Thanks for your interest.

 

Today my application is working in configuration:
Labview 2010
VISA 2.6.1
NI modbus 8.6

I don't know why!

 

I replace VISA 2.6.1 by VISA 5.0.
And I modify the slave diagram to see the error number.

 

My application (the slave) returns the error:
BFFF0015- VISA Write dans MBTS&E_Serial Transmit.vi:1->MBTS&E_SerialSlaveCommunication.vi->ModbusTesteur_S&E_Esclave.vi

 

In my french Labview the possible reason is:
VISA:  (Hex 0xBFFF0015) Le délai d'attente (timeout) a expiré avant que l'opération ne soit achevée.

 

This is not very helpful for me.

 

I try to decrease the Baud Rate but without effect.

0 Kudos
Message 3 of 10
(6,140 Views)

So you have a timeout error.  That means your other device didn't return a response.

 

1.  Check your serial port settings.  Make sure you are using the correct serial port number (e.g. Com1) for the port you have the cable connected to.  Check baud rate, stop bits, parity.

2.  Make sure you are using the right kind of cable  (null modem vs. straight through)  Though if you have gotten this to work with the examples or the older version of LabVIEW, then this one probably isn't the problem.

3.  Increase your timeout a little bit.  But anything from 2-5 seconds should be long enough.

 

You say you do have it working in LV 6.1?  Run NI-SPY with your LV 6.1 version and see what data is being transmitted.  Then run it again with your LV 2010 version.  Compare.

0 Kudos
Message 4 of 10
(6,132 Views)

Thank you for these suggestions.
I do not think that the serial connection is the problem because it works with Labview 6.1 and I do not change anything.
Of course to compare is a good method.

0 Kudos
Message 5 of 10
(6,110 Views)

Following your suggestions, I looked at the serial port configuration parameters.
And  i discover that old VISA version accept 0 in timeout without problem.
For the new VISA version the value of timeout must be at least 1. If it is 0 VISA write return an error.

 

This is perhaps for that the icons are different.

23884i875264DA7A8031B4

 

Thanks for your help.

0 Kudos
Message 6 of 10
(6,081 Views)

The VISA write in all recent versions of LV looks like the one on the left (the one you called old).

 

I have never seen the one on the right with the watch.  Nor have I seen one that has a timeout input.

 

Perhaps that is coming from some legacy .llb or .lib file as a result of the conversion from an older LabVIEW.  If you look at context help on the VISA functions on your block diagram, does it indicate they are coming from sort of library file?

 

Now that you've upgraded, I'd recommend you just go through your VI and delete the VISA functions and replace them with the corresponding VISA functions that are a part of the palettes  (Instrument I/O >> Serial).

0 Kudos
Message 7 of 10
(6,069 Views)

Yes, by safety, I replaced the VISA functions.

 

Precision about icons, on a PC with Labview 2009 SP1, Labview 2010 and VISA 5.0 installed.

With Labiew 2010, the VISA Write icon appear like this in the palette:

 

24032i51D518F251008C78

 

And when I place it in the diagram:

24034iA190201F09761AF9

 

Finally there is no old or new as I said previously.

0 Kudos
Message 8 of 10
(6,054 Views)

I took a closer look at the function.  I realize what the difference is.  Right click on the function Synchronous I/O Mode.  If it is set for Asynchronous it shows the watch.  If it is set for Synchronous, it does not show the watch.  It defaults to Asynchrnous and shows the watch by default when I drop it on the block diagram.

Message 9 of 10
(6,035 Views)

Excellent! 

0 Kudos
Message 10 of 10
(5,980 Views)