C-style variable arg list handling in Call To Library VI?
I have Labview 6.0 on a Windows 2000 PC and I have a DLL with routine that I am trying to call in a VI. I am using the Call Library Function VI to call this routine. My problem is this. The routine uses a C-style variable argument list (like the printf function). In other words, the routine can accept any number of arguments and will decide how many of those arguments to process and what those arguments mean based on the values of the arguments.
Is there a way to handle such variable argument lists in Labview, or do I have to create a different VI for each possible argument list length?
Thanks. So, just to double check, the only way to work with a DLL routine that can have arbitrary numbers of arguments is to guess ahead of time how many arguments there will be and create the appropriate number of terminals? I have a related question which you might be able to answer. I've noticed that some VIs offer a "add terminal" contextual menu option. If wanted to create a wrapper VI for a Call to Library Function VI that calls on a variable argument function and handles some intermediate processing, could I give such a VI a "add terminal" option? If so, how do I manage added terminals within the wrapper VI?
Thanks,
Neal
Similar Messages
-
Handler called in library can only used passed variables?
I have been redoing a 3000-line program to put handlers in an assortment of libraries.
I've been getting a lot of variable undefined errors after calls to the handlers in the library.
Previously, I declared global variables and the handlers, when they were in the same script, had no problem with them.
Global variables do not seem to include handlers in called libraries as part of their scope.
In fact, I can't even Set a new variable in one of these handlers, unless it has first been passed as a parameter in the handler call.
For example, variable var1 in handler HandyHandler
set var1 to 1
results in a variable undefined error unless I call the handler:
HandyHandler(var1)
thus passing the variable from the main script.
This is more than a little awkward.
Is my perception correct: all variables in a handler must be defined in the calling script and passed as parameters?Hello
It's hard to make advice without seeing actual codes. The boiled down essential version to demonstrate the problem would suffice. Also it might help to read the examples and explanations in the following threads.
Externalise functions into a library
https://discussions.apple.com/thread/5116224?tstart=0
tell/scoping problem
https://discussions.apple.com/thread/2477010?start=0&tstart=0
Re: re: my parent
https://discussions.apple.com/message/11852193
Regards,
H
Message was edited by: Hiroto (fixed the last link, but it still may not work...) -
What handler is called when a Status-Bar-Icon is clicked in Cocoa-Applescript?
In Cocoa-Applescript Xcode, what handler is called when the Status-Bar-Icon for my app is clicked? Are there any variables or connections that I have to make?
Thanks Red_menace! I don't know what the Apple community would do without you.
For others viewing this question, the following is the proper format, for Cocoa-Applescript:
property NSStatusBar : class "NSStatusBar"
property StatusItem : ""
on applicationWillFinishLaunching_()
set StatusItem to NSStatusBar's systemStatusBar's statusItemWithLength_(current application's NSSquareStatusItemLength)
StatusItem's setAction_("myAction:")
end applicationWillFinishLaunching_
on myAction_()
say "Hello!"
end myAction_
Where "myAction:" is the action that you want to call when the Status-Bar-Item is clicked. It should also be noted that this handler will not be called if a menu or view is already linked to it's click action. -
Want detailed sample code(value list handler pattern) for my case
I am trying to write a Session Facade Bean with getAllUsers() method which get Collection pased from my UserBean(entity), to get all my users info.and I have a helper class called UserInfo
public class UserInfo implements java.io.Serializable
public String userid;
public String username;
public String password;
public UserInfo()
public void setUserInfo(String userid,String username,String password)
this.userid=userid;
this.username=username;
this.password=password;
I dont' know How my ejb client(jsp maybe) to use value list handler pattern to implement getting all users shown.
I found http://java.sun.com/blueprints/corej2eepatterns/Patterns/ValueListHandler.html the sample code is to complex.
any one could help me figure out ...
what helper class do i need .or maybe interface
what is the best practice?
thanks in advanced.Hi,
For a J2EE system with session facades, I've implemented that pattern based on the DTO pattern.
The idea is based on Sun's blueprint Pet Store implementation.
For that' I've created a DTO called "ListChunk", which holds a chunk of the complete list. In the Pet Store
application v1.3.2 it's called "Page".
So, those facade methods that would possibly return a huge list (such as getAllXXX and findXXX)
return a ListChunk. As arguments, those methods take start index and the maximum size.
If you want a value-list handler to control the iteration on your client side, you code such a class that
uses the facade method.
Here's some code:
public class ListChunk implements Serializable {
private List list;
private int startIndex; // starts on '0'
private int totalSize;
public ListChunk(List list, int startIndex, int totalSize) {
this.list = list;
this.startIndex = startIndex;
this.totalSize = totalSize;
public List getList() {
return list;
public int size() {
return list.size();
public boolean hasNext() {
return totalSize > (startIndex + list.size());
public boolean hasPrevious() {
return startIndex > 0;
public int getTotalSize() {
return totalSize;
}And a method in the facade could look like this:
public ListChunk getAllCoWorkers(int startIndex, int maxSize, CoWorkerSortBy sortBy) {...} -
Connecting To Same Value List Handler
I have a question about using the Value List Handler pattern. Right now I am just working on the design of my application (class diagrams, scenario diagrams, etc).
I have a VLH that will retrieve data from the DB (via a DAO) and will return data to the caller. The VLH basically fronts the DAO. The caller in this case will be a Business Delegate. So the call sequence is:
client (JSP) --> Business Delegate --> Value List Handler --> DAO
Now the VLH is a stateless EJB. But the Business Delegate is just a plain Java class that will get instantiated on every call to the server. My hope is that it will connect to the same VLH instance (I use a ServiceLocator). But I'm not sure this will happen.
According to what I read about Stateless Session EJBs, they are dedicated to a single client. But what is the "client" in my scenario? Is it the browser session? Or is it the Business Delegate? If its the latter, then will new instances of the Business Delegate be able to connect to the same VLH?Use a stateful session bean! Says so on the Sun Blueprints site for this pattern.
-
Buildall.sh env: javac: Arg list too long
Hi, Having trouble building dbxml in SmartOS (opensolaris).
While building Berkeley DB for Java in a long javac command, the script breaks with error:
env: javac: Arg list too long
make: *** [db.jar] Error 126
$ getconf ARG_MAX
1048320
returns a fairly high number - I built the same on FreeBSD with a much smaller number.
Any suggestions on how to get this built and what is causing the problem?
Thanks in advance!WORK AROUND:
cd ./dbxml-2.5.16/db-4.8.26/build_unix
create file dbsrcs.txt that lists all the java source files listed in the JAVA_DBSRCS environment variable
it should look like this:
../dist/../java/src/com/sleepycat/util/ErrorBuffer.java
../dist/../java/src/com/sleepycat/util/ExceptionWrapper.java
../dist/../java/src/com/sleepycat/util/ExceptionUnwrapper.java
../dist/../java/src/com/sleepycat/util/PackedInteger.java
../dist/../java/src/com/sleepycat/util/keyrange/KeyRange.java
save dbsrcs.txt file inside dbxml-2.5.16/db-4.8.26/build_unix directory
# nano Makefile
find line:
$(JAVAC) -d $(JAVA_CLASSTOP) $(JAVACFLAGS) $(JAVA_DBSRCS)
and replace with
$(JAVAC) -d $(JAVA_CLASSTOP) $(JAVACFLAGS) @dbsrcs.txt
while inside the dbxml-2.5.16/db-4.8.26/build_unix directory, run make, to just compile Berkeley DB only
once completed, go back to dbxml-2.5.16 and run
./buildall.sh --enable-java
since Berkeley DB was already built, the build script will see this and skip the Berkeley DB compile since it's already compiled! -
Help needed: variables may not have been called
Here's the program, just compile it, it'll out put that 'loop' and 'c' may not have been called and doesn't compile. here it is....
class GCDTest {
public static void main( String [] args ) {
// Make sure we get exactly two args.
if ( args.length != 2 ){
System.out.println( "Usage: java GCDTest int int" );
return;
System.out.println("pre call");
int a = Integer.parseInt( args[0] ); // first arg is a
int b = Integer.parseInt( args[1] ); // second arg is b
GCDTest the_object = new GCDTest();
// print value of iterative method
System.out.println( "gcdIterative(" + a + "," + b + ")=" +
the_object.gcdIterative( a, b ) );
// print oracle's answer
System.out.println( "gcdRecursive(" + a + "," + b + ")=" +
the_object.gcdRecursive( a, b ) );
} //main
public int gcdIterative( int a, int b ) {
int c;
System.out.println("first call 1");
boolean loop;
boolean d = true;
if (b > a) {
c = b;
b = a;
a = c;
System.out.println("first call 2");
while (loop) {
while (d) {
if (a >= (2*b))
a = a-b;
else d = false;
c = b;
b = a-b;
a = c;
if (b == '0');
loop = false;
return c;
//your while-loop goes here.
} //gcdIterative
public int gcdRecursive( int a, int b ) {
if ( b == 0 ) return a; // base case
return gcdRecursive( b, a % b ); // recursive case
} //gcdRecursive
} //GCDTestbecause you have declared c in you method
public int gcdIterative( int a, int b ) {
int c;
System.out.println("first call 1");
boolean loop;
boolean d = true;
if (b > a) {
c = b;
b = a;
a = c;
so when u call your variable from another method that is normal that your compiler can't find it.
The best way, define your variable outside your method or call your method within your loop.
Hope that help you -
On an iphone 4s, when I tap the phone number in my contacts list instead of calling the number it goes to a "Welcome to mail" screen with icloud, Microsoft exchange, Gmail, Yahoo, Aol & Windows Live Hotmail listed beneath. How do I make it call the number instead?
Never heard of that. I suspect it thinks that's an email address and you're seeing that screen b/c you don't have an email account setup on your iPhone.
Assuming the number is valid, try a reset by pressing the home and sleep buttons until you see the Apple logo, ignoring the slider. Takes about 5-15 secs of button holding and you won't lose any data or settings. -
I have an .IAK file that has several (about 130) different fieldpoint devices in it and each device has about 90 variables names listed. I have modified all the names in order to shorten them and standardize/nomalize the variable names. I would like to be able to just rename the variables in the IAK file, instead of going to each device, connect, 'find devices' in MAX, Save the IAK File (which takes about 10min each) and then drive to the next device and repeat the process 130 times. I've seen programs that let you view the IAK file, just wondering if the IAK can be edited programmatically.
The reason is the IAK file has ALL 130+ fieldpoint devices listed, with approx 85 tags per FP, and I have to get the tag information from each site, then I have to copy that file to the server and reload the server. If (like what happened yesterday) there is a problem saving the .IAK file or the .IAK file gets corrupted, I have to go back to ALL 130+ FP devices and get the information again. Also, with that many FP stations in the IAK file, it takes a considerable amount of time per save (approx 10min). On the server, I get the data from these FP devices through OPC that uses the .IAK file. It's really not an idea situation, but it's what I have to work with.
If it can't be done, it can't be done. I would think that the file has to be saved in some format, granted probably some proprietary NI format, but if I knew the format, I could write a program to edit it, unless it's also compressed in some propritary NI format. -
I have downloaded 4 films purchased on my Ipad to my laptop but can only play 1. The other 3 do not have a screen symbol in the list and are called ie The Lion King - Extras. How can I play the films?
Hello Bagpus113
Check out the article below to troubleshooting issues with the sound for music and for videos. One other thing you can try is to convert the songs to a different format
iTunes and QuickTime for Windows: Audio does not play or plays incorrectly
http://support.apple.com/kb/TS1362
Troubleshooting iTunes for Windows Vista or Windows 7 video playback performance issues
http://support.apple.com/kb/ts1718
iTunes: How to convert a song to a different file format
http://support.apple.com/kb/ht1550
Regards,
-Norm G. -
Only the number, not the name, is shown in the list of missing calls
When number X calls me I get the contact's name like this:
If I don't answer the call and go to the list of Missed calls, I will only find the number (not linked to the contact). Not the name of the contact.
This happens to contact with many numbers added. Could this be the reason?Hi,
I am just giving the solution what I have done in my project. Hope this will help:
DATA: BEGIN OF it_ccode OCCURS 0,
bukrs TYPE t001-bukrs,
butxt TYPE t001-butxt,
END OF it_ccode.
DATA: wa_ccode like line of it_ccode.
Select Company Code (bukrs) and Text (butxt) from table T001.
SELECT bukrs butxt
from t001
into table it_ccode.
LOOP AT it_t001.
ADD 1 TO lv_index.
ls_additional_data-fieldindex = lv_index.
ls_additional_data-fieldname = 'FIELDNAME_KEY'.
ls_additional_data-fieldvalue = it_t001-bukrs.
APPEND ls_additional_data TO additional_data.
ls_additional_data-fieldname = 'FIELDNAME_LABEL'.
CONCATENATE it_t001-bukrs '-' it_t001-butxt
INTO ls_additional_data-fieldvalue.
APPEND ls_additional_data TO additional_data.
ENDLOOP.
And the form my fields binding is:
$record.FIELDNAME.DATA[*].FIELD
Try this out. Hope this will help.
Regards,
Amit -
"Key and Text" values in variable selection list for a field
Hi,
we have created the variable for the one of the navigation attributes of the "0customer" field .
for the customer field in BEX settings we are having "Text" as display.
for the navigation field in BEX settings we are having "Key" as display.
while running the reports in the variable selection list for some reports we having both KEY and text for selection and for others only text are displayed,
we have checked the BEX settings in field and query level there are same.
Please help us here.Check the setting again in the Query level and then maku sure you save it. Come out of the query and then re-open the query and execute, you can see the chages in the output.
-
Can I have a variable that lists the name of the Book?
Hi, I'm creating a document as an InDesign Book, ie a lot of documents in the Book Pallette. I'd like to have a variable that lists the book name. Is this possible?
I've tried finding how to create new variables but I can't see anything. I'm guessing <$bookname> is the code but I can't figure out how to enter it as a variable in CS5.
Thanks,What does this have to do with scripting? I don't believe you can create a variable that is automatically populated with the book name, but you can simply create a regular variable and synchronize it across all documents in the book.
-
How can i get a list of latest calls received
how can i get a list of latest calls received
Hi Jeff280
Great question! You can see your usage online at www.verizonwireless.com/myverizon Then view my usage. At the top of the page you can click the blue hyper link to see current usage.
JoeL_VZW
Follow us on Twitter @VZWSupoort -
Query - select values for variables form list / Bex 7
Hello together,
when I open a query in the 'Business Explorer Analyzer 7' and I want to select the values for my variables from list, BW shows always the values from history.
Is it possible to change this? I want to see always the single values.
Thanks and best regards.
JörgHello Jörg
The variable values in history are shown in drill down button of variable input box, whereas a button beside it will show a list of values when clicked. These are F4 value help selections.
How is variable created? Please create variable with basic settings as
'single value'.
Regards,
Asit Ramteke
Maybe you are looking for
-
No hard drive found on disk utility while booting from OS X dvd
My Macbook crashed recently, the screen wouldn't give me video when I opened the lid from closing it earlier and the fan was doing its ominous thing with getting louder and louder. I had to force shut down. On restarting it wouldn't boot beyond the i
-
Hi Everbody, Am using the FM "BAPI_DOCUMENT_CHECKIN2" to checkin the file in to DMS system. Backend Systen ERP is configured with DMS system , When FM of above is executed from backendsystem file gets attached. But Scenario gets different when i use
-
Caltyp24_Call Type Real Time All Fields Service Level Today discrepancy
Hi All, During our initial phase of deployment to CUIC reporting tool we want to offer similar features to our team to ensure smoother transition. However, I'm seeing discrepancy in data pulled by two different reporting engines - Webview 7.5 and CUI
-
InputVerifer unable to exit with cancel button.
Just playing with the verifier and notice that I am unable to "cancel" when I failed the validation. I understand that I can not conintue to next field, but if I failed but how come I can't cancel out of the form? I could exit if use the [x] on the u
-
Extracting parameters from URL for forms 6i
Is there a way to get the portal logged in user in a 9ias forms 6i web form. Also if I pass user-defined parameters through a link to forms 6i is there a way I can extract these parameters from the URL and get forms 6i to read them? Any ideas will be