Hello,
I was trying to import the psu1000D.dll into labView but I nead a header file in the format of .H so the pcsu1000.bit files won’t work. Does someone have a header file for labview or know how I can create one? Thank you.
Hello,
I was trying to import the psu1000D.dll into labView but I nead a header file in the format of .H so the pcsu1000.bit files won’t work. Does someone have a header file for labview or know how I can create one? Thank you.
To read the data from the PCSU1000 oscilloscope you need also the DSOLink.DLL.
The PCSU1000D.DLL is needed to control the oscilloscope operation.
You may start by using the DSOLink.DLL. The PCSU1000 oscilloscope program must be manually run from the PcLab2000SE.
Here is the header file for the DSOLink.DLL:
[code]#ifdef __cplusplus
extern “C” { /* Assume C declarations for C++ */
#endif
#define FUNCTION __declspec(dllimport)
FUNCTION void __stdcall ReadCh1(int *Buffer);
FUNCTION void __stdcall ReadCh2(int *Buffer);
FUNCTION bool __stdcall DataReady();
#ifdef __cplusplus
}
#endif[/code]
There was no header file for the PCSU1000D.DLL.
I think it should look like this:
[code] #ifdef __cplusplus
extern “C” {
#endif
#define FUNCTION __declspec(dllimport)
FUNCTION void __stdcall Voltage1(int VpDiv);
FUNCTION void __stdcall Voltage2(int VpDiv);
FUNCTION void __stdcall Time(int TpDiv);
FUNCTION void __stdcall RunOn(bool Run);
FUNCTION void __stdcall SingleOn(bool Single);
FUNCTION void __stdcall YPosition1(int y_pos);
FUNCTION void __stdcall YPosition2(int y_pos);
FUNCTION void __stdcall TrgOn(bool trg_on);
FUNCTION void __stdcall TrgLevel(int TrgLevel);
FUNCTION void __stdcall TrgSource(int CH1_CH2_Ext);
FUNCTION void __stdcall TrgEdge(int Positive_Negative);
FUNCTION void __stdcall Coupling1(int AC_DC_GND);
FUNCTION void __stdcall Coupling2(int AC_DC_GND);
FUNCTION void __stdcall Show_PCSU1000(bool Visible);
FUNCTION void __stdcall Start_PCSU1000();
FUNCTION void __stdcall Stop_PCSU1000();
FUNCTION bool __stdcall GetSettings(int *SettingsArray);
#ifdef __cplusplus
}
#endif[/code]
In these declarations int = LabVIEW int32
Those header’s seemed to work. But after building a vi that only reads the data and running it the vi crashes labview every time. I tried reimporting the library and now am getting errors. I’m not sure what’s going on.
Does this function cause the crash: ReadCh1(int *Buffer); ?
If the calling convention is not the problem then the problem may be the size of the allocated data buffer array in LabVIEW.
As a result the DLL fills an array of 4100 integers of type int32.
I’m not sure how to figure out what is causing the problem to be honest. Any suggestions?
Is there problem only if you read the data from the oscilloscope?
Have you tried the functions of the PCSU1000D.DLL.
Doesn’t any of them work too?
E.g. Start_PCSU1000();
Not sure if this helps, but if I stick the data ready.vi in a while loop and run it, the result is it will run, but the status indicator light never turns green. if i run the data ready.vi followed by the reach ch 1.vi in a sequence it crashes.
if I try the start.vi in the pcsu1000.dll it starts the program but I get the error i/o 103
[quote]the result is it will run, but the status indicator light never turns green[/quote]I think you are now using only the functions of the DSOLink.DLL.
In this case the oscilloscope program must be set to “Run” (or click the “Single” button) to get TRUE from the function:
DataReady();
if I already have the program open and use the run on.vi it does start successfully, but I tried the previous vi’s with the program already running and that is not the problem
[quote]I get the error i/o 103[/quote]This indicates that the oscilloscope program doesn’t find the file pcsu1000.bit.
As you see in the VB and Delphi examples, the pcsu1000.bit is located in the same folder with the application.
You have to put the file pcsu1000.bit to a folder where the LabVIEW application is.
okay, the bit file problem is fixed. However it is still crashing when building a simple code that implements a reach ch1. The last time however it just froze labview instead of crashed.
Are you sure there is no buffer overflow…?
To be sure, you may try by using a buffer of 5000 integers (of 32 bit).
That very well could be the problem, So do I put a constant of 5000 for the buffer in on the read, then is the buffer out wired to my chart with data conversion? If it’d be easier I could send you my vi.
Sorry – I have no LabVIEW to test your code.
All the assumptions concerning this problem are based on the general use of the DLLs in programs.
You should allocate space for the buffer.
In this function
ReadCh1(int *Buffer);
the parameter ‘Buffer’ is a pointer to the array of 4100 integers.
okay, it will run on with a single on.vi and 5000 wired to buffer in for the reach ch1.vi However, I can’t seem to wire anything to the buffer out to use the data acquired without it crashing?
I found a document containing this kind of dialog to define the DLL function.
What are the alternatives for the “Pass” selection?
Pointer to array of…
I couldn’t really get to the same window. I got to something similar and I could change the data type, but still crashes when hooked up to anything
Can you define the buffer size too ?
yes by wiring a constant to the buffer in on the vi. I think that defines the buffer size.