Quantcast
Viewing all 5686 articles
Browse latest View live

Keysight DAQ970A sending SCPI commands

Hey Everyone,

 

I am trying to program a Keysight DAQ970A using Labview but I am finding the pre-made instrument control VIs rather lacking as there are several options I cannot set through the VIs.

Does anyone know how to send generic SCPI commands to the instrument using Labview?

 

The specific command I need currently is the ROUTe:CHANnel:DELay specified in the SCPI programming guide which can be found here:

https://www.keysight.com/dk/en/assets/9018-04756/programming-guides/9018-04756.pdf

 

Thank you in advance for any assistance you can provide.


Does VISA.NET API has a equivalent for VisaNS.ReadToFile() function

I am working on getting a hardcopy from a scope, but don't know how to set the buffer size when getting the image data.

I found the following example which using the MessageBasedSession.ReadToFile() function to streamline the instrument read and file write to a single function call. I want to use the VISA.NET API, Is there a equivalent function in VISA.NET API or any other ways to set a proper buffer size?

Thanks in advance!

 

 

 

using System; using NationalInstruments.VisaNS; namespace instr_control { public class Program { static void Main(string[] args) { MessageBasedSession Scope; string resourceString = "USB0::0x0699::0x03A6::C010000::INSTR"; Scope = (MessageBasedSession)ResourceManager.GetLocalManager().Open(resourceString); string path = @"C:\"; string fname = @"temp" + DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + ".bmp"; Scope.Timeout = 5000; Scope.Write("ACQuire:STATE STOP"); Scope.Write("HardCopy:FormatException bmp"); Scope.Write("Hardcopy:Layout Portrait"); Scope.Write("HARDCopy:INKSaver OFF"); Scope.Write("Hardcopy:port USB"); Scope.Write("Hardcopy Start"); try { Scope.ReadToFileAppends = true; do { Scope.ReadToFile(path + fname); } while (Scope.LastStatus.Equals(VisaStatusCode.SuccessMaxCountRead)) ; } catch (Exception exp) { Console.WriteLine(exp.Message); } Scope.Dispose(); } } }

 

 

 

Initialization error for HP 8563 due to lack of REN

I am using a HP 8563 spectrum analyzer which normally works fine with the Agilent 856x Series drivers.  Occasionally after a power cycle, the initialization generates an error, and doesn't connect with the instrument.

 

For context, this instrument is old, uses 488.1 commands (i.e. ID? instead of *IDN?) and I am using a Agilent USB-GPIB controller with Agilent VISA secondary.  NI VISA is primary, with a compiled LabVIEW application running on the 2013 RTE.  There are several other 488.2 instruments on GPIB bus, that don't have any issue.

 

This can be resolved by using the NI MAX "Assert REN; Address Device" command to force it in to remote mode.  After that, everything is back to normal until after power is shut off or an occasional random hiccup.

 

Does this sound like using the GPIB function "GPIB Initialization Function" with the "If assert REN with IFC" boolean set to True would this?  I suspect the instrument doesn't like to respond unless REN is set first.

Fluke ProSim 8

I have a Fluke ProSim 8.  Is there driver support or documentation on how to control this device.

Any pointers would be appreciated.

 

Lake shore 218 using Agilent USB connection

I have a Lake shore 218 temperature sensor which is connected to the computer on the USB port using an Agilent cable. The lake shore supplied software detects the device. 

I have installed the 218 labview plug and play drivers on my system and the LV instrument pallette shows the LSC218 as an option.

 

However, LV cannot detect the actual sensor.

 

Any help how to resolve this or is something wrong in my understanding ? 

SSI encoder simulation

Hi,

 

I have to simulate an encoder with SSI interface, Please let me know a suitable hardware from NI.

 

The application is simple, my controller will clock the pulses, and my simulator should respond with simulated data that I will be sending through LabVIEW.

 

( I was thinking of using NI USB-485 - But I'm not sure if it will work)

Regards

Naveen

PXIe-2738 resource name missing

Hi,

We are now using the PXIe-2738 switching matrix. Using the NI Switch Soft Front Panel, the system works well. However, we also want to control the switching matrix using Python using the NI Switch Python API.

In order to connect to the instrument, we need to input the VISA resource name, but that is not present in NI Max. The instrument does show up in NI Max and we are able to control it with LabVIEW, but we don't see any VISA resource name listed for the instrument (see screenshot)

Image may be NSFW.
Clik here to view.
Horse.PNG

  

.

For other elements (e.g. PXIe-6361) the resource name is there (see screenshot)

Image may be NSFW.
Clik here to view.
Goat_highlight.PNG

 

How can we find the resource name of PXIe-2738?

 

Regards,

Davide

Time synchronization

Hi,

 

Is it possible to get serial data and accelerometer data at the same time?  

time synchronization? 

 

I made two codes to get serial and accelerometer data separately.

 

I use NI cRIO and NI 9870 

 

Thank you. 


Nidaqmx lib not found in Heroku

Hello everyone.

 

I am trying to remotely read data from an accelerometer. I am using a NI9234, developing in windows 10 through python (using the nidaqmx library). I am also using a Flask based web data frame (I think) named pyplot-dash. This libray is special for web applications, as the one that I am intending to create. For internet deployment I am using a cloud platform named Heroku, however I am having some issues in there. 

 

When I run my script on my local host, I am able to read the data from the accelerometer:

Image may be NSFW.
Clik here to view.
dash-sol-2.png

When I deploy into Heroku, the final internet page gives me no errors at all, however, the button that is supposed to implement the nidaqmx functionality is not working at all. Heroku have this command that creates a log (check, please, the attachment)

 

And from there, I believe that this line is crucial:

 

2021-06-19T01:12:48.609542+00:00 app[web.1]: raise DaqNotFoundError(
2021-06-19T01:12:48.609543+00:00 app[web.1]: nidaqmx._lib.DaqNotFoundError: Could not find an installation of NI-DAQmx. Please ensure that NI-DAQmx is installed on this machine or contact National Instruments for support.

 

I asked in StackOverFlow, but so far I haven't found a solution.

 

I tried to use the Ctypes alternative, but I can't run the example provided.

 

I need to add that I am a newb to Heroku, Python, and Plotly-Dash, so I don't know what I am doing wrong.

 

 

 

 

 

 

VI_ERROR_TMO when a computer does a query to a function generator

Hello,

I am using a peaktech 4046 : 160MHz Function/arbitrary Waveform Generator. I developping on pyton and I am using the pyvisa librairy.
The connection is well established and the generator applies the query. But it generates the following error and stops the program (it doesn't do anything after the error).

 

Here is the code :

 

```
import pyvisa
rm = pyvisa.ResourceManager()
inst = rm.open_resource('TCPIP0::130.79.192.123::5025::SOCKET')
print(inst.session)
print(inst.io_protocol)

inst.query("source1:function squ")
```

And here is what I have in my terminal :

 

```
2
IOProtocol.normal
Traceback (most recent call last):
File "c:\Users\Labo préclinique\Desktop\ProjetPython\importation de librairies\Forum.py", line 7, in <module>
inst.query("source1:function squ ")
File "C:\Users\Labo préclinique\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvisa\resources\messagebased.py", line 644, in query
return self.read()
File "C:\Users\Labo préclinique\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvisa\resources\messagebased.py", line 486, in read
message = self._read_raw().decode(enco)
File "C:\Users\Labo préclinique\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvisa\resources\messagebased.py", line 442, in _read_raw
chunk, status = self.visalib.read(self.session, size)
File "C:\Users\Labo préclinique\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvisa\ctwrapper\functions.py", line 2337, in read
ret = library.viRead(session, buffer, count, byref(return_count))
File "C:\Users\Labo préclinique\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvisa\ctwrapper\highlevel.py", line 222, in _return_handler
return self.handle_return_value(session, ret_value) # type: ignore
File "C:\Users\Labo préclinique\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvisa\highlevel.py", line 251, in handle_return_value
raise errors.VisaIOError(rv)
pyvisa.errors.VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.

```

I have tried (to no avail) :
-changing SOCKET to INSTR
-using a timout much longeur ( inst.timeout = 10000)
-adding a end term (tried \n and \r) with : inst.read_termination = '\n'

So I don't know what to do anymore... I need to give more than one command, so the program must not stop so fast. I suspect that my function generator is not sending anything back, but I don't know how to make sure this is the case.

What I wish to know is : Why do I have a time out error if the connection is well established and the request is executed on the device ? How to do the request in a proper way ?


Thank you in advance !!

PS : I know how to catch the error (with try except) but I'd rather have an Ok answer thant a KO one.

 

PXIe-8510/6

Where to find the pinning for LIN PXIe-8510/6.

Thanks

How to connect HX711 to load cell and then NI DAQ 6003

Hello,

 I wanted to interface a load cell to the computer. I am using Futek load cell with 4 wire output. This will be connected to the HX711 pre-amplifier and then the output needs to be fed to the NI DAQ 6003. Can you please help me with a flowchart for this connection?. 

Turning on SRQ on the GPIB to Serial/RS232 Converter Box

I'm using the NI GPIB-RS232 converter box in S-Mode connected to a PLC which is sending the box command strings. When I send "rsv 65", it should turn on the SRQ signal and set bit zero of the request byte to 1. However, the SRQ light stays off. If I send "rsv" again to check the status, it replies with "65" which means bit 6 of the request byte is ON. According to the manual, asserting bit 6 turns on the SRQ line. However, when I send "lines" (status of GPIB control lines), it shows that the SRQ line is OFF which coincides with the status light also being off. So my question is: how do I turn on the SRQ control line in S-Mode?

ENCODER INCREMENTAL, HOW CAN I SEE VALUES ON PC

Hi everyone (sorry for my poor English).
I have an incremental rotary hohner encoder, from it comes out a serial port (male)
which if I'm not mistaken emits signals of the ttl type (square wave, 8 channels or A, A ', B, B', 0,0 ', +, -);
I would like to know how to somehow connect the encoder to the pc in order to obtain information on the pc (bit)
regarding the rotation of the encoder. Thanks and sorry for the ignorance

NI RT 8861 - Display Console output on Host PC through Serial Port

Hello,

I am trying to view the console output from my NI RT 8861 using a Serial-USB port connection to Host PC. When connected through PuTTY session on the Port (COM5 in this case), the console is empty. I have all the relevant Start-up settings in NI MAX for the PXI chassis

 

When connected through Display port1/2 from the chassis and de-select the Enable Console Out option from the start-up settings in chassis, I can clearly see the output from Real-Time system

I am not sure if I am missing something or the PXI chassis does not have the capability to spit the console output via Serial-USB connection. Please advise.


How to control ESP 300 directly from Python?

I am using ESP Ulti software to control ESP 300 Motion Controller. It is connected to the computer by GPIB.

Image may be NSFW.
Clik here to view.
AiNguyen_2-1624555833538.png

 

I can use command code through Terminal in ESP Ulti to control ESP 300 as shown in the picture. Professor asked if I could use Python to control ESP 300 directly without ESP Ulti. I only have a little basic knowledge of Python so would like to ask for help. The professor said the goal is to put it into LabView after the Python code is complete and use LabView to control the ESP 300.

 

Thanks in advance

 

Are Eltima Virtual Serial Ports visible in Measurement&Automation and usable ?

Hi,

I need to test a driver developped with LabView for a hardware that I don't have => I plan to develop a test software and to use paired virtual serial ports (created with Eltima Virtual Serial Ports Driver), but I wanted to know first if this works and if these virtual ports will be visible in M&A and writable/readable in LabView.

Thank you.

Visa error (hex 0xBFFF001D) and error (hex 0xBFFF0015)

Hello all,

 

Basically I have a problem to connect my old digital scale to the computer. This scale have a RS232C serial port that only have a transmission pin and a ground pin (the specification of the pore is attached), so it should transmit data continuously (according to the vendor) without any commanded. I tried to connect the scale and the NI MAX is recognized the scale but when I go to the VISA test panel I have a error message in the view attributes page, and when I push the read bottom in the input\output I have another error that you can see in the attached pictures. I will be grateful if someone could help me to fix this problem, and if it is even posable to connect the instrument that only transmits data with VISA or LabVIEW?

 

thank you 

 

Image may be NSFW.
Clik here to view.
ilyas_0-1624949425887.png

Image may be NSFW.
Clik here to view.
ilyas_1-1624949540914.png

 

Image may be NSFW.
Clik here to view.
ilyas_2-1624949565065.png

 

PCIe-8431/16 in Linux

I have installed a PCIe-8431/16 card on a machine that runs RHEL8. Having installed ni-software-2020, including the ni-serial package, I was expecting the number of serial ports that would be available to increase to at least 16. However, I am only seeing four ports.

 

Having researched this a bit, I ensured that the 8250.nr_uarts=xx parameter gets added during booting of the machine, but I am still unable to see any of the additional ports. I have also ensured that the user is part of the dialout group.

 

I believe that I am not loading the appropriate kernel module for this card. I have tried loading the ni-serial module, without any luck. 

 

Please find attached the screenshots showing the output from lspci -v and the NIVisaic command.

 

How to restart a USB connection without unplugging USB?

Posted in LabVIEW and Instrument Control forums.

 

I working with a device in which I sometimes have to reset the USB connection in order for a command to work. This entails unplugging and plugging the USB back into my computer. Is there a way to do this via LabVIEW without physically unplugging and plugging it back in? Or is there a way to use a power supply and a spliced USB cable to take away power and resupply it back to the USB?

Thanks.

Viewing all 5686 articles
Browse latest View live


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