이 내용은 고객님의 설정 언어로 확인할 수 없습니다

이 내용은 다른 사용 가능한 언어로 표시됩니다. 고객님께서 사용하시는 브라우저에 텍스트 번역에 도움이되는 기능이 포함되어 있을 수 있습니다.

How to Automatically Launch and Use GPIB Interactive Control (IBIC)

Updated Oct 2, 2019

Reported In

Hardware

  • GPIB-USB-HS+
  • GPIB-USB-HS
  • PCI-GPIB+
  • PCI-GPIB

Driver

  • NI-488.2

Issue Details

I would like to automatically launch GPIB Interactive Control (IBIC) and execute a set of GPIB functions. This operation would be ideally launched via a script (or batch file in windows). How can I launch IBIC directly to open a script file and execute commands?

Solution

To launch IBIC in a shell script or batch file, you just need to include the path where the executable file is. This process is exactly like launching any other executable file. 

For example, if the file with the GPIB commands is named cmd.txt, a shell script or batch file might look like:

ibic.exe < cmd.txt 

The shell command "<" redirects the standard input to the cmd.txt text file. This syntax applies to most operating systems.

Additional Information

The problem lies in instructing IBIC to execute a pre-written file with GPIB commands from this shell script or batch file. IBIC does not accept any command line arguments and does not have any option to execute the file once it is launched. To accomplish this, you must redirect the standard input when launching IBIC to the file containing the GPIB commands. 

Usually, when an executable file is launched, the default standard input stream is the keyboard, while the default standard output is the screen. Most operating system shell offer commands to change the standard input source and/or the standard output destination. The syntax used is practically the same between all operating systems (DOS, Windows, UNIX, etc). If you were to redirect the standard input from the keyboard to your text file containing the GPIB commands, the operating system would then take the characters from the file and pass them to the program (ibic in this case) as if you were typing those characters. 

Note that if cmd.txt is long, or you expect a long response from the instrument, the information is going to scroll down the screen not letting you see all of the information. To avoid this you can also redirect the standard output to a file:

ibic.exe < cmd.txt > output.txt

This line would execute the commands in the cmd.txt and record the output of IBIC that would normally be printed on the screen to the output.txt file. 

Also note that the mechanisms described are not IBIC commands. These are shell commands that the operating system provides. Refer to your operating system documentation or on the web for more information on shell commands for stream redirection.