I am designing a Simulator of Instrumentation following these steps:
1) re-programming, re-compiling, and re-building the DLLs from the advanced class simulation drivers included in IVI Driver Toolset 2.0 using LabWindows/CVI 7.0;
2) then i create a VI in LabVIEW 7.0 which calls an IVI Class Driver obtaining the desired simulated output data.
My problem is that I need to share variables between different DLLs in LabVIEW.
I want to simulate a circuit which consists of a battery and a resistor. I've got 2 instruments: a DC Power Supply and a Digital Multimeter.
The DC Power Supply acts as the battery providing a certain voltage level, and the Multimeter measures the Voltage and the Current in the resistor.
I've designed a VI in LabVIEW which uses 2 different sessions: one which calls the class driver IviDCPwr, and the other one which calls IviDmm.
I wish to be able to access the attributes from "nisDCPwr.c" in the file "nisDmm.c".
For example, to write a line like this:
Ivi_GetAttributeViReal64 (ViSession vi, ViConstString channelName, NISDCPWR_ATTR_MEASUREMENT_BASEV, 0, &reading));
inside the source code "nisDmm.c" of the advanced class simulation driver.
The problem is that the only ViSession accessible from nisDmm is the handle from the Digital Multimeter, but not from DC Power Supply.
Would this be possible? Is it "legal"?
I've tried another approach through the declaration of external variables, but unfortunately I get a run-time error in LabVIEW.
The only solution I've found is using auxiliary files going between, through the functions included in the Low Level I/O Library .
Nevertheless, the solution proposed above would result much more convenient, faster and safer in my application.
I hope everyone has understood my question, and anyone can help.
THANK YOU VERY MUCH FOR YOUR TIME!!!