Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all 5665 articles
Browse latest View live

NI 488.2 from VS2013 C++. How?

$
0
0

This has been very frustrating.

I'm trying to use a NI GPIB board to talk to an instrument. This needs to happen in C++ (not .NET) because it needs to run as a compiled executable in a tester platform.

I'm running VS Professional 2013. I have installed the latest GPIB software, version 17.0.0. 

 

In NIMax, interactively everything works fine. We just need to initialize, send a command and receive an answer. ibfind, ibwrt, ibrd is ALL I NEED. 

 

The latest version of the GPIB User Manual (2015), has this to say on p. 4-12: Microsoft Visual C/C++ (Version 8.0 or later): 

With Microsoft Visual C++ (Version 8.0 or later), to compile and link a Win64 console 

application named cprog in the Visual C++ x64 Command Prompt using the environment 

variable, "NIEXTCCOMPILERSUPP", type in the following on the command line:

cl /I"%NIEXTCCOMPILERSUPP%\include" cprog.c 

"%NIEXTCCOMPILERSUPP%\lib64\msvc\ni4882.obj" /MD

 

Frankly, this is B.S. 

 

I use:

#include "ni4882.h"

 

In order to have the code compile, I copied ni4882.h and ni4882.obj into a local folder. The code compiles, but none of the commands works. 

 

ibdev(0,6,0,T3s,1,0)

 

fails with -1. AND I DO NOT SEE ANYTHING IN GPIB TRACE in NIMax (whereas I see it when I run commands interactively). 

 

Can somebody please help:

- what do I have to do in VS 2013 to correctly link the functions so that they actually work?

- would linking to DLL work better?

 

I think NI documentation is really lacking here...

 

Thank you for your help!


Hex 0xBFFF003A error with Keithley 2400 sourcemeter

$
0
0

Hello guys, 

I have a problem that I have been scratching my head with for a week. I have a Keithley 2400 sourcemeter, I want to control it with my computer using Labview. I have done the following steps: 

1- I used the Labview Instrument drivers but unfortunately executing any labview driver results in this error: 

           

  VISA:  (Hex 0xBFFF000E) The given session or object reference is invalid.

 

2- I could communicate with the device using the simple serial communication example. but the device just responds to the write commands. I can set some parameters on the device but I can't read anything. 

 

3- Using NI max I still can send commands to the device, but trying to read the status byte or  sending any read commands results in error: 

 

VISA:  (Hex 0xBFFF003A) Unable to start operation because setup is invalid (due to attributes being set to an inconsistent state).

 

I am using labview 2017, and serial to usb converter (ch340). I don't know where this frustrating issue comes from and I haven't been able to fix it. 

IVI Compliance Package Installation Issue

$
0
0

I'm trying to install IVI Compliance Package 4.5 so I can run my oscilloscope software. The two components of interest are IVI Shared Components 32 and 64 bits. When I try to modify them in the Features list of the installer, I get an error saying

"You may not set the 32-bit IVI Standard Root Directory to the 64 bit Program Files folder or any of its sub-directories
Reset path to previous value?"

The two options are Yes and No. "Yes" clears the error and lets me proceed with installation. "No" hides the error message, but it pops back up whenever I click anything in the installer. This happens no matter what directory I'm installing to.

 

When I get to the progress bar screen and install the programs, I get an error after 50% completion (presumably after 32 bit completes and 64 bit starts) that says

"The 64 bit IVI standard root directory cannot be equal to or a subdirectory of the 32-bit Program Files directory.

 

Continue?"

 

I get an error installing the product whether I click yes or no.

 

I've had the same error with compliance package 4.5 and 17 and I'm at my wits' end. Does anyone have any ideas?

Programmatically generate SRQ

$
0
0

Hi everybody,

 

I am writing an instrument driver based on VISA API for an electronic load device (from a german brand, "Elektro Automatic"). The device is successfully accessed as a TCP/IP socket ressource thanks to VISA API (init, reset, close, identity queries, device configuration...). 

 

The only problem is that this device is not able to generate  SRQs (it is written in its programming guide), and I have an heavy test system software that relies on the use of SRQ if any device encounters a problem. The system must see a SRQ to properly stop the running test and close every initialized device.

 

I periodically poll the status byte of my device to get its state in one of my driver's separated thread. I am able to detect a default on the device, and I would like, from my driver's code, to programmatically generate a SRQ.

 

Does anyone knows if it is only possible ?

 

Thank you for your answer !

 

Best regards,

 

François.

GPIB-USB-HS error -37051, -37052, -37053

$
0
0

I had a VI that was having errors every few hours (see attached "Keithley2700-7700_4point-and-TC (GPIB commands for enhanced stability)").  This VI and sub VIs originally had a bunch of VISA read/write which I thought might be the issue, so I replaced them with GPIB read/writes.  Afterwards, it still had an error after 5 hours.

 

I experimented with resetting the buffer every loop iteration and preformed DCL and IFC commands (removed from attached vi files, replaced with addressed GPIB CLR function), performed steps to reset if communication error with the GPIB-USB-HS(https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P8wnSAC), prevented the USB power from being turned off (https://www.pcworld.com/article/3045567/windows/how-to-keep-charging-your-usb-devices-past-your-pcs-bedtime.html), but now I can't communicate with my GPIB-USB-HS converter.  I've tried to do both the MAX resets (hardware and software) for the GPIB-USB-HS, which seem to go through, but the self-test is bringing up Error -37501, -37502, or -37503.  At one point I got an error to come up in Interactive Control but can't remember for sure what it was (8000 EDVR 0, I believe).

 

Could anybody tell me how to get my GPIB-USB-HS working again?  I'm hoping if it's good to go everything will run better.  

 

Note:  I've also purchased (not yet received) Ferrite cores for the USB cable which was suggested in 6th comment down (https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/EDVR-Error-with-0xe01e005b-error/td-p/1504238)

Interface a Schneider Electric Zelio SR2 with Labview

$
0
0

Hello,

 

First off I want to give you a bit of an overview so you know what the PLC/smart relay is doing. The relay as of right now is programmed using the Zelio software to turn on and off switches, motors, and actuators. I want to be able to create an interface for the Zelio so I can see how many operations the program has done without having to go into the test area as well as change output settings. This would all be done serial through the USB cable.

 

Equipment:

Labview

Schneider Electric Zelio SR2 B201BD

SR2 USB01

 

Any help on how to connect Labview to the Zelio would be greatly appreciated. 

 

Thanks.

Does RS-485 2-wire mode actually require only 2 wires?

$
0
0

Hi everybody,

 

I am using the on-board RS-485 port on a cRIO-9035 to communicate with a temperature controller. The controller is using 2-wire RS485, terminated with a DB9 with three pins on it, (A-, B+ & GND). The pinouts for the cRIO RS-485 port shows connections for 4-wires; TXD-, TXD+, RXD- & RXD+. I have established communication by shorting the TXD- & RXD- on the cRIO and connecting to A- on the temp controller and shorting the TXD+ & RXD+ and connecting to the B+ on the temp controller (see attached image). This works.

 

My question, however, is related to the port 'wire mode' attribute. I have tried changing it to RS485/Wire2-Auto in the hopes that it would remove the need for me to have to short the TX & RX wires at the cRIO but that didn't seem to work. Was hoping somebody could enlighten me on to what the purpose of this attribute is and what I should set it to, given my configuration. If there is any way to avoid having to short out the TX and RX wires, that would also be neat - though not a huge deal. If anything I'm looking to get a better understanding on using RS-485.

 

Thanks!

NI-VISA .NET ReadStatusByte freezes program

$
0
0

Hi All,

We decided to rewrite our huge calibration program to NI-VISA .NET platform. Before start I created simple Project which has only one Counter (Keysight 53230A). We want to use ServiceRequest event of MessageBasedSession object.

We use below code for creating counter object.

 

counter = (MessageBasedSession)ResourceManager.GetLocalManager().Open("GPIB0::17::INSTR");
counter.Timeout = GpibInterface.InfiniteTimeout;
counter.ServiceRequest += Counter_ServiceRequest;
counter.EnableEvent(MessageBasedSessionEventType.ServiceRequest, EventMechanism.Handler);
//this starts new measurement and trigger SRQ when finish counter.Write("*CLS; *ESE 1; *SRE 32; INIT:IMM; *OPC");

 

 

When I run the program it reaches Service Request sub program and freezes at ReadStatusByte() line. If I omit this line, program reads data from counter and starts new measurements but ServiceRequest sub program does not call again.

 

private void Counter_ServiceRequest(object sender, MessageBasedSessionEventArgs e)
        {
            MessageBasedSession mb = sender as MessageBasedSession;
            if (mb != null)
            {
                //Program freezes this point
                //If omit this line, service request function does not run again 
                StatusByteFlags sb = mb.ReadStatusByte();   
                listBox1.Items.Add(mb.Query("FETCH?"));
                mb.Write("*CLS; INIT:IMM; *OPC"); //Restart measurement...

            }
        }

I tried AutoSerialPoll On or Off and results are same. I updated NI-VISA to 17.5 which is latest version.

 

 

Any idea?

 

Best regards,

 

Adem


TDK Lambda GEN 150-10

$
0
0

Hi All

 

I have a TDK Lambda power supply unit and would like to control it using Lab View 17. I see that the VI instrument drives for this hardware from NI does not support Ethernet interface for this unit only IEEE, serial and USB interfaces.

 

I need to use LAN connection. Do I add a switch as a middle man between my PC and the power supply units or can I use a LAN to USB adapter cable and then use the USB VI drivers?

 

I am new to Lab view so do mind the silly question and help is much appreciated.

NI-488.2 for Mac OS X 64-bit compiler error

$
0
0

When I try to compile a program I wrote under x86 64-bit architecture to communicate/use a GPIB-USB-HS+, I get a linking error telling me that the program cannot find the NI4882.framework library.

The program compiles and runs under 32-bit architecture.

Documentation for NI-488.2 indicates that it supports 64-bit, but it doesn't seem to. Am I accessing the right library?

I get the same behavior if I try to access the NI488.framework library

Has anyone had any success with 64-bit architecture in the Mac OS X environment? I am using an Intel Mac mini running 10.11.6

Programmatically Distinguishing Between Multiple Serial Devices of the Same Model

$
0
0

Hello,

 

I am updating 8 test rigs that turn and measure the torque applied to multi-turn valves. For each rig, two serial connections are sent to a PC so I have 16 different devices where 8 devices are one model and another 8 are a different model. My problem is that I need to distinguish which device is sending/receiving information based on both its rig and its model.

 

The devices in question are Interface's Model 9834 Torque Sensor Indicator and Automation Direct's Model 4850 Stepper Motor Driver. Both of these devices use an RS-232 protocol. I thought that one way of distinguishing between these devices was to send a command to each device that asked for some kind of identifier for the device and compare it to the id of the device that I was looking for. However, after talking to both company's tech support, there is no such identifier command.

 

My next idea was to route these devices through a cDAQ because I know how to programmatically id the cDAQ through its serial number. However, the only C module that I found which supports RS-232 is only supported by cRIO which is out of my budget.

 

I am a bit stumped at this point. Does anyone have an idea on how I can programmatically identify which device is sending/receiving information from the PC?

 

Note: The current program hard codes the com ports that the serial connections are assigned to but this is problematic since the rigs needs to be more mobile and unplugging and plugging these rigs can change how the com ports are assigned.

 

Mitsubishi PLC FX-3G PLC

$
0
0

Hello All,
I have LV 2013, and LabVIEW OPC server and DSC module installed on my PC and want to use LabVIEW as HMI as the logic/control part will be written in Mitsubishi FX-3G PLC.

To communicate with LabVIEW, an expansion board from Mitsubishi is used (FX3G-232-BD) and will be connected to COM port of PC.
But I am not able to understand how to connect it with LabVIEW and how to communicate. I have gone through OPC tutorial but I dont know how to use it. Can Anybody please provide me a simple example where I can see the PLC device and read and write data to PLC.

 

Thanks & Regards

JP

can't use NI IO Trace

$
0
0

I can't use NI IO Trace 17.0.1 on my development PC.  When I start it it looks different from all my other installations.  I have tried uninstalling and reinstall all the National Instruments software to no avail.  I can't use it to open .nitrace files (it defaults to labview files)

 

Can anyone offer me some suggestions?

 

NIIOTrace.jpg

VISA Close während .exe-Ausführung

$
0
0

Hi,

 

um einen Prüfling zu testen, kommuniziere ich mit diesem über RS232. Während der Ausführung muss ich jedoch ein externes Programm starten, dass ebenfalls auf diese Schnittstelle zugreift. Dazu habe ich, bevor ich das externe Programm starte, die VISA-Schnittstelle über "VISA-Close" geschlossen.

In der Entwicklungsumgebung funktioniert nun die Ausführung einwandfrei, das externe Programm kommuniziert über die Schnittstelle.

Nachdem ich nun eine .exe (Anwendung, kein Installationsprogramm) erstellt habe, bekomme ich aber keine Verbindung mit dem externen Programm auf die Schnittstelle (ist wohl blockiert).

 

Kann ich in einer .exe-Anwendung die Schnittstelle nicht während der Laufzeit über "VISA-Close" schließen, das externe Programm starten, kommunizieren lassen, und anschließend wieder mit LV weiter kommunizieren lassen?

 

Viele Grüße

delevopper

Arduino Duemilanove atmega32 connection failure

$
0
0

Good day

 

I am using labview to control a push-pull solenoid via Arduino. i get a connection error that says:

 Error 5002 occured at Ini.vi. Unable to establish connection with Arduino.  Please ensure that you have selected the correct COM port and that you have flashed the Arduino with the correct firmware.

 

Any idea how i can overcome this please?

 

Thanks

 

Nicod


A problem in reading datas seperately with the alicat MFC device in

$
0
0

Hi everyone. I have a question about Alicat MFC device. I have two Alicat device. There is the original block diagram of MFC. It is written with the ring for different devices to get their datas but I need those seperately. So I have to change the ring and add each device separately to see the datas at the same time and collect them simultaneously. There are snippets to see how the code is written. I tried every way but it didn't work properly. For one example, it gives same data, on of them gives error in reading com port etc. Please help. 

here what I changedhere what I changed Original Alicat Device's VIOriginal Alicat Device's VIThe whole VI that I madeThe whole VI that I made 

Install NIVISA and GPIB on Scientific Linux 7.4 64-bit

$
0
0

-------------------
SYSTEM REQUIREMENTS
-------------------
NI-VISA 15.5 for Linux software requires one of the following distributions:
http://www.ni.com/download/ni-visa-15.5/5848/en/

GPIB-488 2015
http://www.ni.com/download/ni-488.2---linux-15.1.1/5926/en/

Scientific Linux 7.4


------------------------------
INSTALLATION FROM THE INTERNET
------------------------------
You should be logged in as 'root' to perform this installation.

Pre-requiste 32-bit libraries and kernel-source

yum install libXinerama.i686 mesa_libGL.i686 kernel-devel

Install 32-bit version of libstdc++

yum upgrade libstdc++
yum install libstdc++.i686
yum upgrade zlib
yum install zlib.i686

------------------------------
INSTALLATION FIRST NIVISA FROM THE INTERNET
------------------------------
You should be logged in as 'root' to perform this installation.

1) Download the ISO image "NI-VISA-#.#.#.iso" from the ftp site into a
temporary directory.

2) Open a Terminal (command prompt) window.

3) Mount the ISO image. This may be done by typing
"mount -o loop <iso-location>/NI-VISA-#.#.#.iso <mount-location>".

4) Make the mount location your current working directory. This may be done
by typing "cd <mount-location>".

5) Type "./INSTALL" to execute the install script, and follow the instructions
as prompted.

------------------------------
INSTALLATION FIRST NIVISA FROM THE INTERNET
------------------------------

Install gpib driver version 15.1

------------------------------
BUG with NiKal
------------------------------

cd /var/lib/nikal/3.10.0-693.17.1.el7.x86_64/nikal
edit nikal.c
ifdef nNIKAL100_kFourParameterDoMunmap
return do_munmap(mm, addr, len, 1);
#else
return do_munmap(mm, addr, len);
#endif

->

ifdef nNIKAL100_kFourParameterDoMunmap
return do_munmap(mm, addr, len, 1);
#else
return do_munmap(mm, addr, len, NULL);
#endif

------------------------------
Compile kernel driver
------------------------------
updateNIDrivers


------------------------------
Check kernel modules
------------------------------
# lsmod | grep ni
nimxdfk 584221 1
nipxirmk 297697 1
nidimk 376929 2 nipxirmk
nimdbgk 459483 3 nipxirmk,nimxdfk
niorbk 120227 4 nipxirmk,nimdbgk,nimxdfk,nidimk
ni488k 224199 2
nipalk 1231884 12 nipxirmk,NiViPciK,nimdbgk,nimxdfk,ni488k,nidimk,niorbk
nikal 115446 6 nipxirmk,nimdbgk,nimxdfk,nidimk,nipalk,niorbk

Measuring Hall Sensor Speed with Incremental Counter via TTL Serial Communication

$
0
0
Hello,

I require to measure the rotational speed and acceleration of a rotor that has 3 hall sensors on it.

 

I have uniquely identified the 6 Hall Sensor states with an iteration count from 0 - 10921 which is being read in LabVIEW during runtime.

 

There are 24 pulses which occur for every 360° mechanical rotation.

 

I wasn't sure if there would be any issues with maintaining speed measurements due to reiteration which is occurring during runtime.

 

I am currently attempting to keep the count value using shift registers, however I haven't succeeded to implement that yet, maybe a fundamental mistake on my partSmiley Sad

 

Is it possible to measure speed with only the reiterative values - if so could someone point me in the right direction with an example of how this can be achieved?

 

Many Thanks.

Keithley 2000 external trigger

$
0
0

Hi all,

I'm using Keithley 2000 DMM for resistance measurement using external trigger (0.5-1 Hz) and official LabVIEW driver. Software as in example "Keithley 2000 Read Single.vi", function: 4-wire resistance, external trigger, "Action Send Trigger" removed, with while loop over Data Read Single.

- when using RS232 software hangs after 30-70 triggers, reboot of system is required to establish communication with DMM.... It's strange because "Data Read Single" has internal timeout and it should execute with an error

- when using NI USB-GPIB cable software is stable, but reads result twice / trigger, it seems that first read does not clear internal flag in Keithley...

tested on LabVIEW 2017 32 and 64 bit, 2016 32 bit, on two Keithley 2000 DMM, two PCs and two RS232 cables...

Switch PXIe - 2527 skipping channel

$
0
0

Good evening,

 

I am trying to make a thermocouple measurements with PXIe-2527 and DMM 4080 based on the accompanying example by NI.

My switch config - 

switch init.PNG

Scan list - "ch0:ch10->com0;"

My switch config

DMM init.PNG

Than what I do is basically - 

1. Set 10 thermocouple  channels

2. start scan 

3. measure with DMM

4. Repeat for all required thermocouple values

measure.PNG

 

for some reason I find that channels are skipped with the following pattern:

results.png

Notice the second row in the fist column the third row in the second channel...

 

Any one had similar issue?

Am i doing something wrong with my scan config?

 

Thanks,

Barukh

Viewing all 5665 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>