07-23-2021 06:59 AM
Hi everyone, first at all, Im very noob with english and labview, I had posted others post when I couldnt connect nothing but now I can connect the devices using a rs232 adapter, I can write commands and the device reponse correctly but the error ocurre when I try to read like *IDN?, the device is enable to do it (In manual). I receive 0 bytes of data and I dont know how to continue.
Im trying with the TTI power supply QL355P like this post:
https://forums.ni.com/t5/LabVIEW/Problem-with-VISA-Read/td-p/3812605/page/2?profile.language=es
The user said that he make his own driver but I dont know how.
I wait you can help me, Im doing my job without that but I know that will be more easily if I get it.
07-23-2021 10:32 AM
Try appending the newline character to your VISA Write such that your "*IDN?" becomes "*IDN?\n" in your code.
07-28-2021 03:42 AM
It has not been solved, in the other post I have been given a C # code that is not implemented in labview and they have told me that it is a time error, but the error is immediate even though I have set the timeout to 20 s.
07-28-2021 03:45 AM
In other places I have read about a flush buffer and in others that it may be by using an RS232 adapter, I continue with the error, I do not understand what it can be.
07-28-2021 06:56 AM
Open NI-MAX, it will have *IDN?\n as the default. Does it work there when performing the query?
07-29-2021 01:07 AM
Minions, I am surely missing something because I do not understand well, I hope you can tell me the steps well, if I open NI-MAX, the COM ports are shown. I have read that from here you can open a testing tool but it does not appear to me either. And I don't know where you want * IDN? / N to appear in NI-MAX. I hope I am not too boring or ignorant and I really appreciate your help.
07-29-2021 06:56 AM
Open NI-Max, under Devices and Interfaces select the port and your screen should look something like this.
Assuming that those on your screen are the proper settings for your port, you can now Click Open VISA Test Panel. Once that opens, select Input/Output and we are now ready.
Click the Query button to see any response from the instrument.
07-30-2021 01:13 AM
Oh, I finally found this tool, I had heard about it many times but had never tried it. I have tried "\, /" without any response, I have changed the timeout and also the termination character. No response.
07-30-2021 01:16 AM
One guy send me this code, He said it work for him, but I dont know to implement in labview:
private bool PSU_Open(string PSU_Port)
{
if (serialPort_PSU != null)
{
if (serialPort_PSU.IsOpen)
serialPort_PSU.Close();
}
serialPort_PSU = new SerialPort(PSU_Port, 19200, Parity.None, 8, StopBits.One);
serialPort_PSU.Handshake = Handshake.None;
serialPort_PSU.ReadTimeout = 2000;
serialPort_PSU.WriteTimeout = 500;
serialPort_PSU.BaudRate = 19200;
if (serialPort_PSU.IsOpen)
{
serialPort_PSU.Close();
}
serialPort_PSU.Open();
serialPort_PSU.DiscardInBuffer();
serialPort_PSU.DiscardOutBuffer();
serialPort_PSU.WriteLine("*RST");
Thread.Sleep(2500);
serialPort_PSU.Close();
Thread.Sleep(100);
serialPort_PSU.Open();
serialPort_PSU.DiscardInBuffer();
serialPort_PSU.DiscardOutBuffer();
int dev_chk_timer = 0;
PSU_receiveBuffer = "";
while (true)
{
serialPort_PSU.WriteLine("*IDN?");
Thread.Sleep(20);
PSU_receiveBuffer = PSU_receiveBuffer + serialPort_PSU.ReadExisting();
if (PSU_receiveBuffer.Contains("QL355TP"))
{
MessageBox.Show("QL355TP PSU Found!");
break;
}
else if (dev_chk_timer >= 100)
{
MessageBox.Show("QL355TP PSU Not Found!");
break;
}
dev_chk_timer = dev_chk_timer + 1;
}
return true;
}
08-03-2021 12:37 PM
Open NI-Max, under Devices and Interfaces, what does that screen look like for that connection? Are the connection settings correct for that instrument?