AnsweredAssumed Answered

vrf Measurementcomputing UL example on compiled functions.

Question asked by VRFuser on Aug 12, 2005
> Looked at the h file, and it helped me further.

Excellent! Sounds like you are doing well.

> some of the example they supplied do not work.

That's nothing new Examples are often the last thing that happens,
usually cobbled together from test code but changed here and there for
clarity. And there's always something else that's higher priority so
mistakes can go uncorrected for quite long. I'm sure if you ask their
helpdesk you can get clarification or correction.

[Range]
> Guess you cant help me here.

Maybe...
The way I usually do that kind of stuff in C is to do an enumeration like
so:

typedef enum vrVoltageRange {
  vrUnused,
  vrPlusMinusFive,
  vrZeroToTen,
  vrAnotherRange
} VOLTAGE_RANGE;

And then the function declaration like so:
int SetVoltageRange(HDEV hDevice, VOLTAGE_RANGE vr);

That way, when you're writing code you see stuff like SetVoltageRange(hDev,
vrZeroToTen); instead of SetVoltageRange(hDev, 2); which is functionally
exactly the same yet conveys less information as you read (this is how we
text programming people keep from going crazy). As a bonus, if you do the
function declaration that way the compiler won't let you pass 2 - you *have*
to use one of the enumeration labels.

So if the argument to the selection function is an int, you're almost
guaranteed that there's probably an enumeration somewhere that specifies
exactly what 0, 1, 2, 3, 4... means.

OTOH, that's just the way I'm used to stuff! I may be way out in left field
there. Unfortunately MeasurementComputing.com won't even let you see an .h
file without paying for the library so I'm afraid I really can't help much
as I've never used it.

Maybe somebody has used the Universal Library & can offer help.
-SHAWN-



---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

Outcomes