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

Captured Jpeg transfer from Instrumental by MMEmory:DATA

$
0
0

Jpeg File transfer from Instrumental to PC.

Hello, Please give your help regarding captured Jpeg file transferring from instrumental to PC via NI-VISA on VB.NET with followings.


DMM.WriteString("MMEMory:DATA? 'AAA.jpg'")
out_Msg = DMM.ReadString

returned message includes <header> and <Bindata>.
<headder> includes Len of Bindata(num of byte).

So I removed <headder> part and converted it to byte style by following.

Dim bs As Byte() = System.Text.Encoding.GetEncoding("shift_jis").GetBytes(remain_msg)

And wrote it as binary.

fs.Write(bs, 0, bs.Length)

After that, File was saved as Jpeg but can't open as pitcure.

I compared with original Jpeg got from instrumental.and I made via above. Actual File size is little bit different from original jpeg.
Also character corruption are seen.

Does someone has idea to fix it ? or any good sample program ?


Can I use a sub cam on CRio 9049?

$
0
0

hi all,

I'd like to get continuous image from USB cam(intel REALSENSE) that is connected to the USB port on CRio 9049.

But I don't know where I can get image (I/O node, or something).

I've seen previous forum(https://forums.ni.com/t5/Machine-Vision/USB-webcam-on-a-cRIO/td-p/3327542), but I cannot find webcamera support of crio 9049.

I'm new to FPGA, so if you need more information, please tell me.

Thank you for your attention.

Help with data transfer from GPIB-USB to controller PC from Yokogawa OSA

$
0
0

Hi all,

 

I am having trouble finding info on how to transfer data that I saved in the OSA to my controller PC through an NI GP-IB USB HS+ cord. I am doing this via pyvisa. I just want to save data on my OSA then retrieve it with a python script through the GP-IB (mostly csv files), without the need of the external thumb drive. I've been doing a lot of work arounds (i.e. saving data from the OSA to variables in my python script then saving those to a .csv file), but this eliminates a lot of pertinent information that normally is included on the saved files you grab with a usb thumb drive. Any help would be appreciated!

OPCコマンド

$
0
0

GPIBをOPENし直した際、OPCなどのレジスタ状態は、クリアされるのでしょうか、ご教授をお願い致します。

(読み取りする関数にてOPCやWAIなどが実行されず、計測完了前に数値をとってきてしまいます。)

Low Profile PCIE card and standard full profile pcie PC

$
0
0

Hello all,

 

We are now in possession of a PCIe GPIB controller(Part Number: 780575-01) and a standard PCIe slots on tower pc, both salvaged from previous projects. So the following are my questions, which am confused of,  before making any final decision on how to proceed further

1. Is there any possible route through which I can fit a low profile PCIe Card to a standard PCIe compatible PC?

2. Will the low profile version card (of the above model and part number) dimensions will fit in a half profile PCIe PC?

3. If option 2 is not compatible, What should be my safe PC form factor so that I can use the available card in my possession and buy a new PC that could fit my card in hand?

I do acknowledge that profiles of card and slots on my are different, but my situation and the protocols my firm follows restricts my options available. You are also welcome to open up and  share your suggestions.

 

regards,

sp

Difference between viWrite and viPrintf?

$
0
0

I know there is the option of formatting with viPrintf, but does it communicate with instruments the same way that viWrite does? Also is there any advantages to using one or the other? Any input appreciated I'm new to using the VISA library.

GPIB-USB-B (P/N: 188417D-01) Letter of Volatility

$
0
0

Trying to find a Letter of Volatility for a GPIB-USB-B (P/N: 188417D-01) adapter. I was hoping someone on the forums might have something.

NI6501 Python NIdaqmx

$
0
0

Hello,

 

It's seems to have bug in module nidaqmx in python to control the channel in output

The read function for channel configurate in output digital seems to work only for port0/line0:3

 

I'm not sure but it's seems that moreover the output digital comes is replaced by a input digital when a read is performed.

if you launch my program below you will see that

print(f"do_read : {do_read}") indicate 15,, so only the port0/line0:3 is changed and on the board NI6501, the situation is confirmed

 

If you remove the line " read" from the code, all ports, port0/line0:5 is modify on board

 

I see also that the nidaqmx has not been updated until 2017. Is it normal ?

 

import nidaqmx
from nidaqmx.constants import LineGrouping

dev_str = "Dev1/port0/line0:5"
# nidaqmx.do_output_drive_type = nidaqmx.constants.DigitalDriveType.OPEN_COLLECTOR
with nidaqmx.Task() as task:
task.di_channels.add_di_chan(dev_str, line_grouping=LineGrouping.CHAN_FOR_ALL_LINES)

with nidaqmx.Task() as task:
task.do_channels.add_do_chan(dev_str, line_grouping=LineGrouping.CHAN_FOR_ALL_LINES)
# task.do_channels.do_overcurrent_limit = 0.0001

# print(f"Drive type avant : {task.do_channels.do_output_drive_type}");
for chnl in task.do_channels:
# chnl.do_output_drive_type = nidaqmx.constants.DigitalDriveType.ACTIVE_DRIVE
chnl.do_output_drive_type = nidaqmx.constants.DigitalDriveType.OPEN_COLLECTOR
print(f"Drive type après : {chnl.do_output_drive_type}");

task.start()

task.write(15+32+16)
print(f"do_write ");
# print(f"do_is : {do_is}");
do_read = task.read(number_of_samples_per_channel=1)
print(f"do_read : {do_read}")


TSP Syntax error

$
0
0

Hi Team,

I am using Keithley's 2460 source meter.

I am trying to run the "Acquire and sweep measurements" given example in Keithley 2450 instr. lib example,

I got a TSP code syntax error.

please help me with this.

thanks in advance.

Almacenar datos después de realizar una operación viRead/ Storing data after make an viRead operation

$
0
0

 Hola, estoy realizando un programa en Visual Studio (lenguaje c) el cual, tras una operación de lectura, almacena en una estructura los datos del dispositivo con los que se conecta, es decir, su ID y el descriptor del instrumento. No obstante, tras realizar la operación viFindNext, y comunicarse con el siguiente dispositivo, el descriptor del anterior instrumento guardado en las estructura de datos, cambia automáticamente por este. Ocurre lo mismo para el ID en el buffer de lectura, es decir, tras recibir el ID de otro instrumento, cambia el anterior que tenia guardado. Finalmente, se almacena el ultimo instrumento, quedando repetido tanto el descriptor, como el ID dos veces(dos instrumentos leidos). Les dejo el código por aquí. Muchas gracias!!!

 

Hi, i`m making an Visual Studio program(C language), whom, after make an read operation, storing the data of the device what is conected in a structure, that is, descriptor and ID. However,  after making an viFindNext operation, and conected with following device, the descriptor of the before instrument, store in the data structure, autamatically change for this new. Occur the same for the ID in the read buffer, that is, after receive the new ID of the device, chage the ID of the first device store. Finally, store the descriptor and the ID of the last device, remain this repeated in two places. I put the code here. Thank you very much!!!!

 

 

Nota: son dos dispositivos conectados por 2 cables de pares. El equipo detecta cuatro dispositivos en total.

Note: there are two device pair wired conected, so the computer detected four devices 

 

#include<visa.h>
#include<string.h>
#include<stdio.h>

 

#define TAMA 200

 

typedef struct
{
   char caracter; 
   ViBuf ID;
   ViBuf Descrtiptor;

}IV;

 

typedef IV Equipo[2];


void inicializa(ViBuf* buffer);
void almacena(Equipo* equipo, char caracter, ViBuf descriptor, ViBuf ID);
void InicioComunicaciones(ViBuf buffer);

 


int main()
{

  ViBuf buffer[TAMA];

   

   inicializa(&buffer);
   InicioComunicaciones(buffer);

 

   return 0;
}

 

void inicializa(ViBuf* buffer)
{
     for (unsigned i = 0; i < TAMA; i++)
     {
      buffer[i] = ' ';
     }


}

 

void almacena(Equipo* equipo, char caracter, ViBuf descriptor, ViBuf ID)
{
    if (caracter == 'B')
    {
       equipo[0]->caracter = caracter;
       equipo[0]->Descrtiptor = descriptor;
       equipo[0]->ID = ID;

    }
   else
    {
       equipo[1]->caracter = caracter;
       equipo[1]->Descrtiptor = descriptor;
       equipo[1]->ID = ID;

    }

 

 }

 

 void InicioComunicaciones(ViBuf buffer)
 {

    ViSession manejador_sesion, manejador_recursos;
    ViFindList lista;
    ViInt32 num, retcnt;
    ViChar Descriptor[TAMA];
    int contador = 0;

    Equipo equipo;

 

    if (viOpenDefaultRM(&manejador_sesion) != VI_SUCCESS)
    {

        printf("ERROR DE INICIO DE SESION \n");
    }


   if (viFindRsrc(manejador_sesion, "?*INSTR", &lista, &num, Descriptor) != VI_SUCCESS)
   {
       printf("No se han encontrado dispositivos\n");

   }
   else
  {

 

    while (contador !=num)
    {

 

      if (viOpen(manejador_sesion, Descriptor, VI_NULL, VI_NULL, &manejador_recursos) != VI_SUCCESS)
       {

       printf("ERROR DE APERTURA \n");

       }
       else
      {

 

          viWrite(manejador_recursos, "*IDN?\n", 6, &retcnt);


          viRead(manejador_recursos, buffer, TAMA, &retcnt);

 
          char *p=strstr(buffer,"\n");
          *p = '\0';

           char caracter = (char)(contador + 65);

           

        printf("%c.%s [%s]\n",caracter,(ViBuf)Descriptor,buffer);

        almacena(equipo, caracter, (ViBuf) Descriptor, buffer);

               if (contador == 3)
               {


                  printf("caracter[0] %c \n", equipo[0].caracter);
                  printf("descriptor[0] %s \n", equipo[0].Descrtiptor);
                  printf("ID[0] %s \n", equipo[0].ID);

                  printf("caracter[1] %c \n", equipo[1].caracter);
                  printf("descriptor[1] %s \n", equipo[1].Descrtiptor);
                  printf("ID[1] %s \n", equipo[1].ID);
                }

        }

 

 contador++;

 

    if (viFindNext(lista, Descriptor) != VI_SUCCESS)
    {

    printf("ERROR \n");

   }
}

 

    viClose(manejador_recursos);

  }

 

viClose(manejador_sesion);

}

 

 

 

Screen Capture of MSO4104 using Labview

$
0
0

Hi All,

 

 I am trying to acquire a screen capture from a Tektronix MSO4104 oscilloscope using LabVIEW. I currently am able to collect data from the device, and have a waveform displayed on my VI front panel. However for various reasons, our preference is to capture the actual screen shot from the scope. I have tried ryan gs method, but for some reason i cant get it to work on the MSO4104. If anyone can share the solution for the MSO4104 that would be great. Thanks

 

cjones86_0-1615895526752.png

 

Operating a Bronkhorst MFC on NI 9035 cRIO Chassis via RS232

$
0
0

Bronkhorst Mass Flow Controllers (MFC) can be operated in Labview use ASCII programing logic. I've been able to prove the my VI works by directly connecting my MFC to my computer and running it properly. The issue I'm encountering is having the MFC recognize the RS232 ports (NI-9870) I have on a module in my 9035 cRIO Chassis, likely because it is hooked up as a remote system to my main computer. To circumvent this I've also tried running the labview program directly on the Chassis, but am still receiving an error (-1073807339) at the VISA Read step, which in my case I've come to learn means that the computer isn't actually communicating with the MFC.

 

Does anyone have any experience getting any Bronkhorst or similar mass flow controllers to work on their NI cRIO Chassis?

pmod wifi (spi protocol) with sbrio 9651

$
0
0

Hello

 

I want to use pmod wifi with sbrio 9651 FPGA target.

 

pmod wifi is using SPI Protocol.

 

Is there any examples about pmod wifi in Labview??

 

How can I check the response from slave to master??

 

Thank you.

USRP-2920 flash update problem, bricked, Your device does not correctly report its version information

$
0
0

Hi,

I have several pcs of USRP-2920, but 2 pcs of the same age can not be flashed.

In normal run it does not react in any way. Only status LEDs starts up.

In safe mode (S2 button) I can see it in configuration utility, but it is impossible to change the IP or update the images.

When updating the FW and FPGA, there is the omnious warning:

 

Your device does not correctly report its version information. It is possible to damage a device with the incorrect FPGA image revision. Please ensure that you are using the correct image version for your hardware by checking the sticker on the back of the device (e.g. r:2.0 implies that you should use the r2 image file). Press OK to proceed or Cancel to abort.

 

It finishes the update procedure, but nothing changes.

It seems to be a firmware problem.

Does anyone have a solution?

 

Thanks a lot.

 

Martin

VSB Technical University Ostrava

Auto Gain function of SR830 DSP lock-in amplifier via labview with GPIB connection

$
0
0

Hello

 

I'm using Labview 2018 with GPIB-USB-HS+ to connect with SR830

Most of the communications are fine(setting time constant, filter, read data...etc) except one thing: auto gain function

 

SR830 is kinda slow at determine the proper gain level to achieve maximum sensitivity without overload (typically 1~3 secs, sometimes longer), if you attempt to communicate with SR830 before autogain function is done, an error will occur.

 

According to manual from stanford research, by reading Serial Poll Status Byte(bit 1), we can know that autogain is done or not. it should return 0 when auto gain is on-going and return 1 when it is done.

 

However, by sending "*STB? 1" from VISA write and VISA read the response, it always returns 0 regardless autogain is done or not, and the response time of *STB? is pretty slow, too(~1 sec)

 

Currently I set the gain level by manually calibrate it, but it's not really good for automation in measurement.

Does anyone encounter similar problem with SR830 and successfully solve it?

 

I do consult the local agent of stanford research in my country, they only tell me that they never find this problem while using RS232 to communicate with SR830, that's all.

 

 

P.S.

 

Please DON'T tell me to check VI driver of SR830 from NI, I already check it(every SCPI code send by VISA) and just like many VI drivers of other instruments, it contains a lot of subtle bugs which are hard to find. The person whoever write it does not consider the response time of Autogain and it will transfer standard error-out data flow immediately after sending Autogain command, and cause an error, good job bro.

 

 

 


Can someone please supply me with NI488.2 V3.12?

$
0
0

Hello all,

 

Would someone be so kind to send me NI488.2 v3.12? We have ten years of automation, that we are unable to use, as it was coded in Basic, utilizing ULI.com.

 

I found v2.25 on the ftp site, which ULI.com does see, but its not talking to the instruments... I am guess it must be due to the lack of 32bit support, as we are running everything in the command.exe.

 

The setup:

QBASIC

ULI.COM

GPIB-USB-HS

WINDOWS XP

VIRTUAL MACHINE (VMWARE)

WINDOWS 10

 

Thanks in advance!

Error while using Buffer VIs of Keithley 2636A

$
0
0

Hi all, 

 

I am trying to initialize a measurement on the Keithley 2636A SMU, so that the measurement is done by the instrument and data points stored in the instrument SMU buffer. I only want to use LabView to download the data trace (i.e. multiple measurements saved in the SMU buffer)  via GPIB cable to my computer once the measurement is complete. 

I want the instrument to carry out the measurements (continuous sampling), instead of triggering for single measurements through LabView. This way, speed, sampling rate, and # of total measurements of my experiment are not limited by how fast the LabView trigger loop is run, or the buffer size of LabView/GPIB.

With this process flow: 1. initialize instrument and measurement parameters, 2. initialize buffer to store multiple measured data points (e.g. 100 measurements) 3. open SMU output, 4. trigger instrument to carry out the multiple measurements (100 samples) 5. print the buffer data range out to an excel file on the computer, this is the code that I wrote (at end of this note). 

After some troubleshooting on my end, I realize that there is no issue initializing the SMU & measurement (first half of code doing that is fine), but when I use the BUFFER VIs in the Keithley instrument driver lib, I get an error. I was running into errors using the CONFIG BUFFER MODE VI (which is why I am not using that VI anymore in the code). Instead I use the "CREATE READING BUFFER" VI to create a buffer of size 100. And then use "CONFIG READING BUFFER DATA CHARACTERISTICS" to define my buffer. 

This is the error I receive: 

lodhi33_0-1616374296562.png
(Error -1074000000)
I am not sure if this is because I am not using the BUFFER VIs incorrectly, or if the trigger VI I use to call and initiate measurements is not doing any measurements (hence, the "empty buffer").  How do I call a trigger VI so that the instrument knows how many samples to store in the buffer before stopping measurement? 



Please do share if you all have any thoughts on this! Whether I am using the buffer VIs incorrectly or the trigger VI is not filling up the buffer like I think? 

Thanks a lot! 

lodhi33_1-1616375241820.png

Snippet of trigger VI and buffer initialization. Complete VI attached. 

(P.S.) The issue is not that I am not allowing enough time for the measurement after triggering (and before calling the Print Buffer VI. I tried putting a 2 minute delay there, but that does not help

GPIB-USB-HS no light on Ready and Active

$
0
0

Hello,

 

i have a GPIB-USB-HS and it works well before, i found it doesn't work well yesterday and their is no light on Ready and Active, could you help to check what's the possible reason?

 

thanks

Yang LI

Interfacing RMX-4005 DC electronic load in labview VI using USB serial port connection

$
0
0

Hello, I am new to labview.  I am trying to measure the voltage and current of a 100W fuel cell using NI RMX-4005 DC electronic load in LabView. I tried to find the RMX-400x driver through VI package manager but couldn't find anything. I might be doing it wrong. Can anybody guide me through the Process in detail. Your help will be very much appreciated. Thank you

write - read superfluous response NI-MAX Owon oscilloscope xds2102a

$
0
0
 

 

There is a problem:

when communicating with NI-MAX using SCPI commands I got response that cannot be automatically treated:

 

I do "write" NI-MAX via to the oscilloscope to measure cursor rms value: :MEASU:CH1:CURS?

 

Then I do "read" and the  the oscilloscope returns:

"CR : 510mV ->\n"

 

Me labview system cannot work with this format. It can deal only with the namber "510".

 

 

Anybody knows how to get rid off this superfluous "CR :" and "mV ->"?

 

 

 

Viewing all 5663 articles
Browse latest View live


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