AnsweredAssumed Answered

vrf User Function Calls

Question asked by VRFuser on Apr 30, 2008
Mike,

 

Very neat solution.  I can see me using that in the very near future.

 

Cheers,

Gary

 

 

Gary Voltz
SASTO4

Test Equipment and Maintenance and Calibration Centre

Facilities Management Services

Technology and Asset Services

Airservices Australia


E-mail: gary.voltz@airservicesaustralia.com

  _____  

Airservices Australia
Ph 1300 301 120       (within Australia)
Ph +61 7 3866 3382  (outside Australia) 
Fax +61 7 3866 3531
HYPERLINK "http://www.airservicesaustralia.com/"www.airservicesaustralia.com

CAUTION: This e-mail is confidential. If you are not the intended
recipient, you must not disclose or use the information contained
in it. If you have received this e-mail in error, please tell us
immediately by return e-mail and delete the document.

Airservices Australia does not represent, warrant or guarantee
that the integrity of this communication is free of errors, virus
or interference.

 

  _____  

From: Michael N Asbery [mailto:michael.asbery@nrl.navy.mil]
Sent: Wednesday, 30 April 2008 10:40 PM
To: VRF
Subject: RE: [vrf] User Function Calls

 

Take this example one step further, in a formula box

 

myFunction(A,B,C) returns a record with three values val1, val2, & val3

 

In a formula box you have four input pins (A,B,C, & D) and two output pins (T1 and Result).

Your formula is as follows:

T1 = myFunction(A,B,C);

T1.val1 * T1.val2 + D

 

You place in a temporary variable T1, the results of your user function. Then use two of the output values and a third input to calculate your result.

 

I have been using this type of records to control instruments for many years ie

 

takeSpectrumAnalyzerMeasurement(CenterFreq,Span,ChannelWidth) returns a record with 601 point spectrum array, and channel power measurement amplitude.

 

I can then analyze the spectrum or use the power measurement, but the function only returns one record of information.  Much simpler when wiring boxes together.

 

Mike

***********************************************************
Michael N. Asbery                (202)404-3014, DSN 754
US Naval Research Laboratory      fax (202)404-7661
Code 5733.20                    michael.asbery@nrl.navy.mil
4555 Overlook Ave SW
Washington DC 20375-5339                               
***********************************************************

  _____  

From: Voltz, Gary [mailto:gary.voltz@AirservicesAustralia.com]
Sent: Tuesday, April 29, 2008 7:10 PM
To: VRF
Subject: RE: [vrf] User Function Calls

 

John,

 

Using Variables is what I have done in the past to retrieve multiple outputs from a function. However your question has made me think of an alternative.

 

Normal programming methodologies suggest that a function should just do one thing.  So what you can do is put all the outputs into a record and have the record as the only output.  Then in the formula box the record will be the returned value.  This can either be direct to the Result pin or assigned to a value for output on a pin in a multi-line formula ie.  myValue = myFuntion(A,B,C); with an output pin called myValue,

 

Then you can unbuild the record to use the data.

 

Regards,

Gary

 

  _____  

From: KINZIE, JOHN [mailto:JOHN_KINZIE@appsig.com]
Sent: Wednesday, 30 April 2008 8:35 AM
To: VRF
Subject: [vrf] User Function Calls

 

VRF Basic Question here:

A user function may be called in a formula.  The inputs to the user function are in parentheses.  But if the user function returns values on output pins, how are these retrieved?  Or are they not available to the formula call?  If I want to call a user function with a formula, do I have to use globals to get them out?

 

John Kinzie

john_kinzie@appsig.com

Applied Signal Technology, Inc.

214.547.4720

Fax 214.547.4770

 

 


---
You are currently subscribed to vrf as: gary.voltz@airservicesaustralia.com
To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
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".
Search the "unofficial vrf archive" at "http://www.vrfarchive.com/vrf_archive".
Search the Agilent vrf archive at "http://vee.engineering.agilent.com".


---
You are currently subscribed to vrf as: michael.asbery@nrl.navy.mil
To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
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".
Search the "unofficial vrf archive" at "http://www.vrfarchive.com/vrf_archive".
Search the Agilent vrf archive at "http://vee.engineering.agilent.com".


---
You are currently subscribed to vrf as: gary.voltz@airservicesaustralia.com
To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
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".
Search the "unofficial vrf archive" at "http://www.vrfarchive.com/vrf_archive".
Search the Agilent vrf archive at "http://vee.engineering.agilent.com".


---
You are currently subscribed to vrf as: ming_meng@agilent.com
To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
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".
Search the "unofficial vrf archive" at "http://www.vrfarchive.com/vrf_archive".
Search the Agilent vrf archive at "http://vee.engineering.agilent.com".  

Outcomes