incompatible visa read

Hey I am using an Arduino Uno and I have 4 connected thermocouples. The code I have seems to work well, but every ~ 15 readings, at random intervals, the program returns 0 for two or three thermocouples. I added a delay to this program because it did not work without it, but it could also be the source of the problem? I have a 3 second delay programmed to the Arduino and a delay of 1 second to LabView code.

Thank you!

Arduino 1.0.5 code:

#include "Adafruit_MAX31855.h".

int thermoDO = 3;
int thermoCS1 = 4;
int thermoCS2 = 4;
int thermoCS3 = 4;
int thermoCS4 = 4;
int thermoCLK = 5;

Adafruit_MAX31855 thermocouple (thermoCLK, thermoCS, thermoDO);
Adafruit_MAX31855 thermocouple1 (thermoCLK, thermoCS1, thermoDO);
Adafruit_MAX31855 thermocouple2 (thermoCLK, thermoCS2, thermoDO);
Adafruit_MAX31855 thermocouple3 (thermoCLK, thermoCS3, thermoDO);
Adafruit_MAX31855 thermocouple4 (thermoCLK, thermoCS4, thermoDO);
Adafruit + MAX31855 thermocouple5 (thermoCLK, thermoCS5, thermoDO);
void setup() {}
Serial.begin(9600) (9600);

Serial.println ("MAX31855 test");
Wait for the MAX chip stabilize
Delay (500);
}

void loop() {}
reading trial basis, just print out the current temperature
Serial.Print ("internal Temp =");
Serial.println (thermocouple.readInternal ());

Double c1 = thermocouple1.readCelsius ();
Double c2 = thermocouple2.readCelsius ();
Double c3 = thermocouple3.readCelsius ();
Double c4 = thermocouple4.readCelsius ();

If (isnan (c1)) {}
Serial.println ("something wrong with thermocouple!");
} else {}
Serial.println (C1);
Serial.println (C2);
Serial.println (C3);
Serial.println (C4);

}

Delay (3000);
}

I advise to use the stop for VISA reading character.  This way you will not need the byte to Port function.  Just put the bytes to read something rediculously high.  You'll need to have your Arduino out a supply at the end of each transmission line.  Which tends to clear up many of the communication problems.

Tags: NI Hardware

Similar Questions

  • Incompatible VISA read starting from 3458

    See the attached screenshots. My goal is to capture 4000 datapoints to a ramp of output voltage of 0 to 5v, with 3458A in LEVEL triggered 1v level, starting from the SALT ON signal that allows the output of the unit. I confirmed all signals are OK with a scope, but I can't get the 3458 to SYSTEMATICALLY capture the waveform. Whenever I run the screw, I get random numbers of datapoints varying between 5 and 4000 desired. Why can not always get my 4000 datapoints? In the screenshots below, the TrigELoadramp, vi immediately following the Setup3458.vi. In vi of this last paragraph is copied from the driver notes Agilent 3458 A, which makes no sense to me.

    Use a property on the VISA reference node.  Property, you need to define is the Message-based settings-> allow termination character.

  • VISA reading significantly slows down to 20 Hz (Labview, Arduino + Xbee project)

    Hello

    I am quite new to Labview and Arduino, so I apologize if I use the incorrect terms. I'm having some trouble with the next project, I hope that you guys can give me some advice!
    I have 16 sensors connected to the 16 analog pins on an Arduino mega Board. This Council has a shield mounted upon him, with a Xbee module wireless. I have another Xbee module that communicates with him and it is mounted on a USB dongle that plugs into a PC with Labview 2015.

    The A/D analog Arduino pin output is read and sent every 50ms to the Xbee module connected to the PC. So every 50ms (that is, a frequency of 20 Hz), a new line of analog readings by commas is sent, using AnalogRead and Serialprint in the Arduino. These data are fed to a Labview code with architecture of producer-consumer. Copy the following code configures a serial port of VISA, reads the data, it converts a voltage value and writes the data to a text file (see block_diagram.jpg).

    The problem is that at a frequency of 20 Hz (with the configuration of the attached jpg) when you reach 400 treatment iterations the code slows down considerably and values are not parsed correctly. It behaves as if the queue is full (but the queue of elements indicators show 0) or memory or the buffers were full. It seems quite surprising to me given that the sampling rate is so slow. I tried a few configurations setting the buffer size, empty the buffer by using the queue time, but nothing seemed to work. Is it because the processor loop takes too much time to iterate? I tried to disable data analysis, conversion of voltage and the generation of text file, just keep reading and still have the same behavior.

    This may be the cause? Suggestions to change the block diagram are welcome! Is there a better way to do this than with VISA or queues...?

    I use Labview 2015 on Windows 7.

    Thank you!!

    sminanog wrote:

    It behaves as if the queue is full (but the queue of elements indicators show 0) or memory or the buffers were full.

    You think along the good things. But the big problem I see here is that you have a table growing up to stop the program.  You must move the file writing to be inside the loop of your consumption.  This will eliminate the need to constantly develop your table in the shift register, with tons of memory and causing copies of memory (which is very expensive).

    The other concern I have is the speed at which data is available.  If you have a baud rate 9600, then in the 50ms debit you can pass 48 bytes.  This leaves 3 bytes per sample, including the comma.  If you have a debit 115 200 baud baudrate, it turns into 576 bytes, you can send the 50ms.  So the lesson here is to make sure that you use a transmission speed which is fast enough to handle the data that you want to send.

  • VISA read lose characters beyond the end of the output string

    Hello

    I wrote a VI to take a string of output data of an ardunio Uno and analysand. I use the vi read Visa to enter the output channel of the unit. In the end I will connect a device that actually gives the value in this type of format string: (#80212164,2289,2292,2296,2300,2328,2289,2297,2290,2300,2308,2292,2295,2298,2289,22,24,0 *).

    So after a large number of loops, the program starts to drop the last characters of the string that it generates. If the string of Visa Read output reads something like (#80212164,2289,2292,2296,2300,2328,2289,2297,2290,2300,2308,2292,2295,2298,2289,22,24,). The only way to solve this problem, once it has occurred must completely close labview (completely). Once I open again and start the program running, all is well in the world.

    Has anyone had this problem? I tried to debug it in different ways and the only weird symptom I have other Visa Read function lose a few characters of the string is the fact that by looking at the bytes to the Port after I read visa, is that she starts showing five bytes instead of zero.

    my last attempt at resolving this issue is attached.

    Note: The Ardunio outputs a string of this format every 2 seconds with the values being incrimental on a specified range. (80212164,2289,2292,2296,2300,2328,2289,2297,2290,2300,2308,2292,2295,2298,2289,22,24,0 # *)

    You can configure the * your character of termination if your Arduino does not send the carriage return or line feed.  Use the configure a Serial Port to ensure that your settings are correct.  You can also use this VI to increase your timeout so that you no longer need your waiting.

  • VISA Read blocks. Download dialogue VI reset on abandonment.

    Windows 7 SP1 64 bit

    LabVIEW version 2011 SP1 32-bit

    Version 5.1 of the VISA

    NOR-488. 2 version 2.80

    When you try to communicate with a GPIB instrument (currently a Keithley 2400 source counter), sometimes the VISA Read VI will hang and never come back.  (Timeout value is set to 10 seconds).  Once this happens the VI THAT VISA read call ignores the button cancel in the toolbar.  Close the front panel of this VI will VI resetting: dialogue of the "appeal of VI name.

    Does anyone know what causes this or how to avoid it?


  • Visa reading reads all bytes to the port

    I have a camera that I communicate via the Serial Port. I have a standard communications protocol. For a particular command, I know that the exact number of bytes expected in return. I send my order. I see the correct number and exepcted to bytes in the port. I then read the number of bytes in the port. However, the VISA read returns only the first two bytes.

    I contacted success with this camera and this Protocol for more than 130 commands unique and different. There are only about 6 orders in which the read visa does not read all the bytes in the port. Anyone know why that would happen?  I expect to see 6 bytes. I see 6 bytes. I have visa read the command with 6 bytes. The visa read returns only the first 2 bytes. It's very very frustrating. I can do this exact process even with a different command. I expect 45 bytes of this command. I see 45 bytes with this command and I read 45 bytes with this command.

    I don't think that it is device connected as I can converse with success with the same camera on the same computer with the same cable of connector using non-LabView. It seems to be a problem strictly related to labview and VISA read the order. If someone could help that would be greatly apprecicated.

    Thank you.

    What is the exact byte stream that await you in return with this command?

    Instead of opening VISA, use the configuration Serial Port VI.  In this way, you can override the default values.  It looks that your instrument using all the defaults VISA of speed in baud rate, start and stop bits, etc.  However, in the VISA software, there is a failure to use a termination character, and this character is 10 (0x0A).  If you use the configure Serial Port, you can tell the pilot VISA do not use the stop character.

  • VISA read very slow communication

    Hello

    IM using serial communications VISA in my project and I noticed that the reading block works very slowly.
    I have the microcontroller that connected to my laptop through XBee modules.
    Baud rate is 9600 due as a change factor in each component in the line won't make a difference at all.
    Also, I checked that it work with terminal XCTU and its working fine (very fast). so his can not be something else except read VISA.
    Please see VI attached file.

    Thanks for any help,

    If you do not use a stop character, then the read VISA will sit and wait that 100 characters have been received by the COM port or the timeout elapsed (which is probably something like 5-10 seconds long). You can change the time-out period (using a property node) or reduce the number of characters you read each time that the loop runs.

    Without a termination character, you will need to build your own string using a shift register buffer - whenever you make a VISA read, add it to the chain on the shift register and then do some analysis to take control of your microcontroller (e.g. alarm, coordinated) and remove all the foregoing orders of the string buffer (for example if you have started the VI in the middle of a command) ", then you don't want to throw these data).

  • Why visa read reads most bytes sent

    Hello
    I use visa read and write to communicate with the device via RS232. I sent several string commands.i just use serial communication of basic to read and write the commands.my total length of string is about 6626. I also used the size of buffer of about 7000. When I send the string to write Visa, I'll get a number (byte) output 6626 sometimes and sometimes less than that. I also used the property node for the bytes to port I used the number of bytes to read visa. But as number of output here, I get a lot more like over 6670 and sometimes less than 4000and 6620 and sometimes only some and 5000 and some.it doesnot remains constant. How can I solve this problem? why I get more bytes that I sent as exit visa read? and sometimes less? And sometimes more visa write number of output?
    waiting for help.thank you.

    Tadhika,


  • increase speed visa read write

    Hi guys,.

    I use the visa read and write the example, but I am facing a problem when using it in a software expansion, and I can receive only date when the vi has been slown down (using the bulb).

    The program really works on her own with the defined settings.

    So, do you have any ideas/suggestions on how to significantly increase the speed of this vi (joint)? In addition, it seems to create a problem with the playback of data

    Thank you very much

    Kentmey

    Roll bytes to the port and the delay.

    Rely on the chariot of the termination

    Use a number larger than the bytes expected.

  • VISA READ timeout error - several GPIB resources

    Hello

    I'm working on a network 3 GPIB instruments (Optical Attenuator, amplifier in fiber, spectrum analyser), controlled using VISA sessions in Labview. When it is run separately, the three corresponding screws (which are located in three different Labview projects) works as expected. However, when they ran at the same time, one gives them timeout-1073807339 VISA READ errors. These errors seem to occur when another instrument is sending / receiving data / instructions at the same time that she is.

    The exact context of the error is either:

    -an another VI is running, which includes sending several requests and responses every 100 ms, reading

    -by failing VI starts, I get an error of waiting time among the first Subvi containing a VISA READ operation to perform (sometimes initialize.vi (in situation 1), sometimes one of the subVIs connected the rest State (State 0) on the time-out of the structure of the event).

    or:

    -the default VI is running,

    -by starting another VI, which includes repeatedly sending requests and reading the responses, the failing VI up a mistake among the first Subvi containing a VISA READ operation to run (one of the subVIs linked the State of rest (0) on the time-out of the structure of the event).

    What I tried:

    -gradually increasing the delay between the VISA WRITE and READ operations to the relevant instrument (from 10 ms to 10 s), without success. More surprising are my observations which, by operating this single VI, increasing WRITE it / READ delay results in the same timeout errors. I have found no mention of such behavior through research google and forum. I hope that this may point to a solution to the main issue,

    -switching between synchronous and asynchronous VISA WRITE / READ operations.

    -reorganization of the network GPIB to a star to a linear topology topology (three instruments have different GPIB addresses in case anyone is wondering).

    My thoughts:

    It seems to me that the error is related to a delay introduced between a VISA request and its read operation by the transmission of another query associated another instrument in the same network GPIB. But I have no idea why pass a query to another instrument would introduce such a delay, or why this delay would result in a timeout error (and only an instrument, while writing / reading in each pilot screws are basically the same). Hopefully a more experienced Labview-er will be able to shed some light on my problem.

    Included is the project that contains the default VI (main.vi) and the driver custom made use of.

    There are a number of ways. If you want to keep separate projects for instruments, you can use semaphores often slandered around calls for screws in each project. Locking is not expected or predictable, but it would give controlled access to the GPIB resource.

  • VISA read timeout

    I don't know why the function of reading im getting an error of timeout to the VISA (error that says "timeout expired before the operation is over"). I made sure the serial port of Labview and my cameras are serial port configured exactly the same. I even tested hyperterminal with the same port as in labview settings and it works perfectly, but my labview program gives me an error. My device ends each order he sent with a carriage return, then I mounted VISA READ to stop playback of data when he meets the CR character. I also made sure the carriage return was infact sent by my camera. Any thoughts?


  • difference between VISA READ buffer and chain

    Hello I'm just starting to use the VISA read and write the function in labVIEW

    everyone knows what are the degree between reading VISA and the string buffer? and the comparison of the VISA Write buffer and chain

    Thank you

    Ein salvation,

    "read buffer" is the string given by VISAReadlabel, "write buffer" is the label of the string that is expected by VISAWrite!

    There is no difference...

  • No VISA Read reading all the bytes available and ordered

    Hi all

    I use Write.vi VISA and VISA Read.vi to send and receive packets of bytes to and from a processor.  Generally, everything works fine.  I put a loop repeats until he sees at least 20 bytes to the port, then I VISA Read to read 20 bytes.   However, when I receive some packets of bytes, my property node indicates 20 bytes to the port, I ask VISA Read to read 20 bytes, but it reads 13 bytes and leaves seven bytes to the port.  If I run the read operation again, it will read their remaining 13 bytes.

    Any ideas on what might materialize this project?

    Thank you

    Forbes

    OK, I thought about it.  I put 'Stop character activate' in 'VISA configure Serial Port' to 'False', and all my problems disappeared.

    It's fun to talk to myself.

    See you soon,.

    Forbes

  • want to use visa read only when the pieces is in port

    Hi all

    I do a lot of serial data communications and visa read doesn't have an undo feature.  Heres so the question.  If I'm in the middle of the read visa, set up the picture picture and block, and I press the stop button, I have to wait for the visa reading for timeout, in this case 2 seconds, before I can move to the next step in the shutdown sequence.  Now, I know, there is a way to use the events of specefic bus, but I have yet to find a good example.  Any help or advice for a workarond for that matter?

    Thank you

    Matt


  • The value read by visa read that VI is not correct!

    I design a labview program to control the Agilent E5072C Network Analyzer. When I want to get the value of this instrument, I use VI "VISA read" listed in the plate. However, the value read from this VI's latest measurement of time value. For example, the last time that the read value is 1.0 db, and this time the measurement value is 1.2 db. But when I use 'VISA read' VI to extract the value is 1.0 db.

    Agilent also provide a VI for this device to read the measurement value and she was always correct value. If someone could tell me why? need to do any action before the value read from this instrument if I want to use VI "VISA reading" instead of Agilent VI?

    You are probably reading too quickly.  Reading it in NOR-MAX, you do it by hand, it takes more time.  When you do that programmatically, it is "instant".  Try using the * OPC? command to activate your order in a query.  He returned then a '1' in the buffer.  Read the '1' and then create the command fetch.

    For Dennis:

    I've had bad experiences with the drivers provided by the manufacturer to the point where I don't even try to use more.  But Agilent is also anal about their drivers, because they are on their books, they should pose no problems.

Maybe you are looking for