vrf driver implementation

"Russell Fix" <russellf@micropulse.com> wrote:> I am trying to use a button and every time I press it I want to increment a> fill bar by one> when I exit I want the value to be stored to a file so when I start the> program it reads the file value and continues to count from there.

The implementation can follow your description almost exactly. Seeexample below

If the data types that the dll uses are not compatible with any of the VEEdata types you must build an "Interface" to them. What I mean is if you havea function that takes a structure or something like that you have to buildan External function that takes the elements in that structure separately orin a known order array and translate it into the structure for the calledfunction. I've used C++ classes like that before too.

I've never used that library, are you sure the data types aren't compatible?Sometimes a manufacturer will use typedefs for things that can really justbe integers, reals, or strings in VEE. Like a Handle to the card orwhatever.

I'll send you my dll example that I've pretty much beat to death, but seemsto answer using compiled library questions for most.

by trying to implement a PC-card (without any HPVEE-drivers),I have the problem, that there are NT-drivers available onlyfor C++ and VisualBasic. They work fine, so I tried to write aHPVEE description file (*.h) for HPVEE-implementation.The problem is now, that the DLL-file contains selfdefined datatypes, which is possible in C++ and Basic, but not in HPVEE.How can I proceed? Are there some standard solutions for this problem?Do I have to write another DLL, where the basic Dll-fileis included and the complex data-types are split into theirbasic types?Perhaps, someone was successful to implement ADVANTECH-measurement-cardsinto HPVEE: please can you share your know-how?

Thanks in advance

Peter---------------------------------------------------------------------This is the "vrf" maillist, managed by Majordomo. To send messages tothis maillist, just email to "vrf@lvld.hp.com". Subscriptions andunsubscriptions are done through the address "vrf-request@lvld.hp.com".If you need details, just send a message containing the text "help"to "vrf-request@lvld.hp.com".---------------------------------------------------------------------

I am trying to use a button and every time I press it I want to increment afill bar by onewhen I exit I want the value to be stored to a file so when I start theprogram it reads the file value and continues to count from there.

---------------------------------------------------------------------This is the "vrf" maillist, managed by Majordomo. To send messages tothis maillist, just email to "vrf@lvld.hp.com". Subscriptions andunsubscriptions are done through the address "vrf-request@lvld.hp.com".If you need details, just send a message containing the text "help"to "vrf-request@lvld.hp.com".---------------------------------------------------------------------

[It occurred to me after I sent this that it went out as a private reply,which doesn't help the group much, so I'm re-sending it to the VRF.]

Happy Holidays, Peter!

> by trying to implement a PC-card (without any HPVEE-drivers),> I have the problem, that there are NT-drivers available only> for C++ and VisualBasic.

This is starting to sound all too familiar. =]

> They work fine, so I tried to write a HPVEE description file> (*.h) for HPVEE-implementation. The problem is now, that> the DLL-file contains selfdefined datatypes, which is possible> in C++ and Basic, but not in HPVEE.> How can I proceed?

I ran into this trouble with the Advantech PCL-1800 A/D card. The solutionin my case, as you guessed, was to create an intermediary DLL that interactswith the Advantech driver, forwarding the collected data back to VEE in datatypes compatible with VEE.

> Do I have to write another DLL, where the basic Dll-file> is included and the complex data-types are split into their> basic types?

One other thing to be aware of, beyond the obvious trouble of VEE'sinability to handle a void pointer, is that (at least in my case), thedriver returned data points as type single, where VEE expected type double.

While it was an unexpected thorn in the side, this solution worked fine forsingle A/D conversions and for lower sampling rates. Our trouble surfacedwhen we had to maintain a 5 kHz sample rate, at which time we changed thesolution altogether.

---------------------------------------------------------------------This is the "vrf" maillist, managed by Majordomo. To send messages tothis maillist, just email to "vrf@lvld.hp.com". Subscriptions andunsubscriptions are done through the address "vrf-request@lvld.hp.com".If you need details, just send a message containing the text "help"to "vrf-request@lvld.hp.com".---------------------------------------------------------------------

> I want this card to measure single values at low samling> rates (some Hz). So it would be for me a great help, if> you could provide me with your selfprogrammed "in between> DLL", since I am a beginner in this kind of (C++) programming.

What might be more helpful is the method used to handle the data typeconversion, since the code to handle the PCL-812 might be different thanwhat I used for the PCL-1800.

ptAIVoltageIn is a structure of type PT_AIVoltageIn, found in the Advantechcode.

I use the glErrCode as the DLL function return code, which is passed backout to VEE, and may then be trapped in your code (so that VEE knows exactlywhat's going on as far as communications with the Advantech driver goes).

The only thing left at this point is to match up compatible data types forthe VEE header file, which goes like this:

> What do you mean by changing the solution altogether> (another A/D-card?).

Exactly. The Advantech driver, from what I was told, was not produced tohandle the higher rates we required. So rather than writing a new hardwaredriver to get us the rates desired, we opted to go with a KeithleyKPCI-1802, and began re-writing the code in VisualBasic.

---------------------------------------------------------------------This is the "vrf" maillist, managed by Majordomo. To send messages tothis maillist, just email to "vrf@lvld.hp.com". Subscriptions andunsubscriptions are done through the address "vrf-request@lvld.hp.com".If you need details, just send a message containing the text "help"to "vrf-request@lvld.hp.com".---------------------------------------------------------------------

> Thanks for your example, showing how to overcome the> problem of non-HPVEE-compatible datatypes in a *.DLL.

You're more than welcome. I've taken enough from the list just in"lurking," and I was glad to be afforded an opportunity to contribute.

> Just a question according your example:> in the c-code, the function VDRV_AIVoltageIn has 4 parameters.> But in the VEE-header file you defined 5 input-parameters.> The correct version should be, that the parameter "DeviceHandle" is> also an input of VDRV_AIVoltageIn, isnt it?

You got me. =]

I apparently missed that rather important parameter in the C function call.It should be the first parameter, type long. Good catch.

---------------------------------------------------------------------This is the "vrf" maillist, managed by Majordomo. To send messages tothis maillist, just email to "vrf@lvld.hp.com". Subscriptions andunsubscriptions are done through the address "vrf-request@lvld.hp.com".If you need details, just send a message containing the text "help"to "vrf-request@lvld.hp.com".---------------------------------------------------------------------