Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

help with serial read/write

I am working on a project to interface labview with a basic stamp microcontroller bs2px.  Currently I have Labview sending 4 bytes
1. enable/disable
2. channel select
3 data for channel A
4. data for channel B
 
the data is going out correctly, but when I try to read in a different set of data I am getting framing errors and inconsistent readings.  The data seems to be getting read continuously.  I am very new to labview and need to get this project done for a senior design course.  Any guidance/direction will be greatly appreciated.  Is my code too bulky?  It seems very complex even though I'm trying to do something very simple. 
 
Ultimately I need to 3 -4 reads/writes for several small data sets to display in my GUI.  I need to trigger the micro to send out pulses, receive pulses, and read a voltage.  all of these items will be coming from the microcontroller.

Message Edited by dingram on 10-07-2006 11:16 PM

Message Edited by dingram on 10-07-2006 11:16 PM

0 Kudos
Message 1 of 2
(3,107 Views)
Your code is bulky and overly complex.  I would try to rewrite it without any local variables or sequence structures.  You don't need them and they make things hard to read/debug.  The local variable for the VISA resource name is probably what's causing the framing errors.  Make sure you use the VISA resource name coming out of the VISA config.
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,083 Views)