Current Position:Home > Global variable in Instrument Drivers

Global variable in Instrument Drivers

Update:10-11Source: network consolidation
Advertisement
Hi,
We are designing an Instrument Driver for our devices. We do have VI's that does the same operation but with different Inputs and this Input is a cluster of references.
I would like to gain knowledge if all this VI's can be clubbed together by making those clusters as global variables. Through this way I hope we will significantly optimizie our code.
We are also looking for the drivers to get certified by the NI so looking for any sort of solution if making global won't be a good solution for achieving optimization.
Thanks In Advance,
VIvek
Solved!
Go to Solution.

The Best Answer

Advertisement
I don't quite understand what you mean by "clubbed together". Using global variables will not magically make your code more efficient. There's uses for global variable, and there are places where they should not be used. A reasonable use is to hold data used by muliple processes, though a queue is in most cases a better way to go.
The best way to see how to write an instrument driver is to download recent instrument drivers from the NI Instrument Driver Network. Look for the ones that are project-based as these are done in 8.x and are quite recent. Don't bother with the old drivers - they're a mess. You should be able to find something that's similar to your instrument and use it as a template. There's also an Instrument Driver Wizard that comes with LabVIEW. Another source of information is the NI Knowledge Base. Do a search, and you'll find lots of information. Like this: Developing LabVIEW Plug and Play Instrument Drivers.
You should also read over Ben's nugget on Action Engines. 
  • Global variable in Instrument Drivers Update:10-11

    Hi, We are designing an Instrument Driver for our devices. We do have VI's that does the same operation but with different Inputs and this Input is a cluster of references. I would like to gain knowledge if all this VI's can be clubbed together by ma

  • Instrument Handle Out as Global variable Update:11-30

    Hi, How do i create "Instrument Handle Out" of an IVI function as a global variable. Regards, SidduI don't work with IVI, but this should work - Open the globals VI and add an IVI Logical Name control (I/O palette). As a more generic solution, r

  • Control global variable used in sub vi Update:10-11

    Hi, I've created a vi to read an instrument and to initiate its calibration with labview. This VI stores data in a global variable containing measurments and status of the instrument. Now what I'm trying to do is create a sub vi with this to read&wri

  • Can I read/write global variables that are in other PC? Update:10-11

    I attach the vis and the executables. My problem is that when I run( continuosly, because in other way, I read the default value of the variable) getvalue.vi and setvalue.vi, I don´t have any problem, I can read/write the global variables, the two vi

  • Why do global variables have a .vi extension? Update:11-30

    Hi, While cleaning up some code the other day, it occured to me that although Virtual Instruments and Global Variables are distinct entities with separate roles in the LabVIEW environment, they share the same file extension .vi. It seems much more lo

  • Global variable corruption Update:11-30

    hi im using labview 6.1. i have a frame in a sub-vi that that reads 16 bytes from com7 (in my pc) into a global variable using a custom DLL. this variable is then used later to compare some data in another sub-vi. this was working fine for a day, the

  • Find and replace global variables Update:11-30

    Hi there, I've ran into a mess with my global variables. While I was trying to rename one of the globals, all instances in hundreds of subvis turned corrupt. The icon of the global variable turned black and the wires starting at the variable became b

  • Global variables for circular buffer Update:11-30

    Hallo! I have another question: I need to have a variable circular buffer size. So I would like to define the circular buffer size by a global varable. Is that possible? I tried to use the global variable like {VAR_01} to insert in the desired field

  • Shared and Global Variable Issue with Motor VI Update:11-30

    Hello, I have written a VI that will command a stepper motor to follow the desired profile and loop the profile until the user pushes the stop button. I modified the state machine example from LV to achieve this. I now want to connect a linear potent

  • Storing DAQmx Task in a Functional Global variable Update:11-30

    Happy New Year to everyone! I got a nice little question hoping some of you might be able to help me.... After initializing an starting a DAQmx task (V7.5), I wanted to store the task out reference in a functional global variable, but it seems, it di