07-01-2009 12:49 PM
07-01-2009 01:03 PM
What do you mean by "play button"?
Your spreadsheet file will only contain the data from the last time the VI is run because a True constant is not wired to the Append to File? input.
Even if you did wire a true, you might have a mish-mash of data since one file would contain a mix and match based on the different cases that are run each time the VI is called.
07-01-2009 03:14 PM - edited 07-01-2009 03:17 PM
Oh...sorry it's not a play button it's a RUN button...
the problem was that i want to read specific registers, like only the ones for voltage, frequency, and current, but they are not consecutive registers, so i can not give a starting register and a quantity to read them all toghether, so i tried to build a tab control that contains as many MB serial master query as i need, each one of them for one of my parameter...but when i run the VI only the tab that is in front is running, the other ones are not reading registers, so i have to run each one of them individually....so, i'm in a little bit of trouble
07-01-2009 03:24 PM
In general, tab controls aren't attached to any other code. They are there to just help you organize your front panel.
What you will want to do is create an array of elements that contain all of your various registers you want to read. Put your Modbus code in a For loop. Wire the the array into the For Loop with Autoindexing Enabled. Now the For Loop will run once for each element in the array and use each element of the array in term.
You will still need to turn your VI into more of a program. Right now it only runs once. You will want to put a while loop around all the code that runs continuously (like the communicatio code). Put the initialziation functions before the while loop, and the cleanup functions after the while loop. Use a Stop button wired to the While Loop's Stop terminal to end the program. Much of your code is duplicated unnecessarily right now.
07-01-2009 03:47 PM
07-01-2009 08:42 PM
07-02-2009 03:54 AM
thank you verry much you are the best:D
you saved my life.thank you a lot.
best regards Sylvia
07-10-2010 10:51 AM
can somehelp me out. im new to labview. Im doing a small project on communication between two computers via labview on modbus protocol. So we have to select the com port in the field dats written "visa resource name" but somehow there are no options in mb serial init.vi. it only has "refresh". wat could be the reason that i dont see the drop down menu to choose the com port in "visa resource name" ???
07-10-2010 11:21 AM
You really need to start a new thread rather than hijacking this one since you have a different problem.
Do any of your serial ports show up in Measurement and Automation Explorere (MAX)? They have to show up there before they show up in LabVIEW.
Are you sure you have NI-VISA installed?
07-10-2010 07:17 PM
thank you sooo muc. I just had no idea how to do that before. Thanks a ton. And sorry, next time will start a new thread. 🙂
cheers.