07-30-2010 02:50 PM
I was wondering if I concatenated my string and put it in variables and then asked the user the select the values of the variable, is that possible? As in the user should be able to put in the values 1,2,3 or 4 or any number on a pop out box. I am relating this to Java where one can have a Scanner and ask the user to input the value and based on the value an equation can be calculated. Thanks.
Sincerely,
07-31-2010 05:09 AM
If your goal is to simplify distribution of full application and updates, you could embed UIRs into the executable.
08-02-2010 03:40 AM
Are you trying to avoid the presence of a file, or does your application simply not need a GUI? In the first case, you can 'hide' the uir file by embedding it into your exe, as Roberto suggested. In the second case, you could generate a console application, where a simple text/DOS window for input and output (using scanf() and printf()) is used. This still allows for pop-up dialogue boxes such as FileSelectPopup().
JR
08-02-2010 12:06 PM
I would like to use an uir file but for some reason when I operate my program through an uir it doesn't communicate to my instrument. Therefore I am trying another approach for my prog. I have attached the code with the uir incase anyone has a idea where I am going wrong. Thanks for the help.
08-02-2010 01:36 PM
Hi,
The first thing that catches my eye in your code is the inappropriate place for the ibdev function.
You placed it outside the switch(event) block.
This means, that line of code will be run, for example, each time you move your mouse over the numeric controls in the GUI.
Because, moving the mouse pointer is an event for an UIR control, and that causes the associated callback to be called.
The switch(event) block is there in order to filter the events and respond to only the ones you want to.
You will see what I mean if you put a breakpoint on the ibdev line and run your program from CVI in debug mode.
The second thing is actually the place of ibdev. It is a function for opening a connection to a device.
It may be better to open the device in your main() function before RunUserInterface and close the device just before before QuitUserInterface.
You can also use a separate "Connect/Disconnet" type of toggle button for this purpose.
So, your device gets opened only once, and it is properly closed when your program terminates.
Other than these two issues, if you have other questions please specify them clearly.
Hope this helps,
08-02-2010 04:05 PM
I have attached the fixed code. Well my question is my callbacks doesn't communicate with my instrument which is tge Lock In Amp 7265. The goal of the program is to let the user select the digital analog voltage channel and the amount of voltage they want without hard coding it using ibwrt and sending a string. This code I have written, doesn't accomplish that. I don't understand where I am going wrong since but any insight would be much appreciated. Thanks for the time.
Sincerely,
08-03-2010 12:59 AM
You should define the buffers as char writebuffer[8], no need to use '*' before the variable name.
And the buffer size is possibly should be more than 8.
Next, the Execute callback gets the DAC and VDAC values from the GUI, but you do not use them anywhere else.
Beware that, the Fmt function does not automatically append the strings each time you call it.
Debug your code and look at the value of writebuffer as you run each line of code.
Please get help from a C textbook and the GPIB library help of CVI.
There are also lots of built-in examples in CVI installations for GPIB communication.