Jump to content

bwgames

Members
  • Posts

    6
  • Joined

  • Last visited

    Never

bwgames's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I have a VI (screenshot attached) that works fine in highlight execution mode, the search string returns 0, yet when I run it normally, it doesn't match. Screenshot contains probes for the result of the search string and the read buffer. As far as I can see, it should be returning 0, not -1, and indeed it does in highlight execution?? Using LV 8.0 It works fine now, if I reduce the number of !!!'s in the search string, still doesn't really explain why it works in highlight execution only with the original number though...
  2. Thanks - very helpful attachment, its shown me exactly what I need to do, but I've just discovered thats not quite the input I thought I was getting. I have a T/F case statement controlled by a button. When the button is pressed, it sends some commands to the device to program it. When false, it will loop through checking the serial port and if its received anything, it goes into a true case statement, which for the moment just outputs to an array I tried replacing the array with a string indicator, which indicated the string was being written over with each new line, as my input is like: CONF,X,Y\n\r then there is a delay of ~60ms so the loop triggers again, 0,X,Y,Z\n\r delay 60ms 1,X,Y,Z\n\r and so on, which meant that each new line of data was a whole new string in itself. What I see myself now needing to do is append each line to an array? Using spreadsheet string to array works fine in that it converts into a correct 1D array but as I say, it doesn't append the new string.
  3. I'm reading data in from RS232 in the form CONF, 0005, 00040 \n\r 0, 121,23,64 1, 23,54,122 2... etc where thr 121,23,64 etc represents X,Y,Z co-ordinates. I'd like to be able to save this to CSV and display it on a graph. Attaching a array to the output of Spreadsheet string-> array gives me 0,0,0 then on the second line, the correct output but overwritten every time so instead of the above, its 0,0,0 0,121,23,64 then it overwrites that row with 1,23,54,122 etc instead of putting it on the next line. As far as I can see, I'm using the correct EOL character. In spreadsheet string->array, I have , as a delimiter and %d as format string. Also, how would i go about showing this on a graph? I found Array -> Cluster only accepts 1D arrays I found http://forums.lavag.org/index.php?showtopi...string+to+array which is almost identical to what I want, but I can't see how to get from my spreadsheet string to array to 1D array to graph..?
  4. Hiya, I have a VI, where in one aspect of it, I want to read in values (CSV format, so I can use spreadsheet operations) starting from when a specific character is read in, until a termination character is read. I only use this termination character once in this VI, the other Read operations are done using constants for the characters to read in. There is no fixed limit for this, it varies. As this particular character would not be read anywhere else in the VI, could I set it as a termination character anyway? As it would only be reading in X bytes for the other operations. Howeever, the other problem is my connected instrument has an delay between receiving the command and it sending the CSV output, which can be anything from 1 second to multiple days, but it will usually be around 5 minutes. After my VI sends this command, it returns to an overall While loop controlled by a power button. I'm suspecting the easiest way to 'interrupt' when something is received is to enclose everything currently in that while loop in the first frame of a flat/stacked sequence, and do something like if button pressed, do all this, if not, it will move onto second frame, and read serial port... In that, if start-of-data character read in, start reading to file until termination character from above read in, if nothing read in, the while loop would automatically loop back to reading the button, etc. Is there a limit to how much I can read in, the absolute maximum that it will be reading in, in that operation is approximately 300kB - can one VISA read do this?
  5. Thanks for the feedback. The case VI gave me exactly the info I needed. Looking more closely at the Producer/Consumer(Data) template now - this seems to be exactly what I need - use a SubVi in the False case structure to process any button changes, and in the consumer loop, act on the array received from the serial port. One question I do have - how would I set current boolean states of LEDs based on what is in an array cell? I.e. how would I link an array cell to a boolean indicator?
  6. Is it possible, in LabView (8.0), to run two things at once? I.e. I have a front panel with buttons and indicators. Every 5 seconds or so, the device connected via serial port outputs a list of boolean states which should be used to update the boolean state of the FP indicators. At the same time, if a button is pressed on the FP, a command needs to be sent via the serial port. I can do the sending of the command by wiring the T/F output to a case structure and sending it that way (even though it gets horribly complex with ~40 buttons, each one wired to its own case statement - there must be a easier way?), but I'm not sure how to read the serial port at the same time. A timer to read the serial port every 5 seconds probably wouldn't work due to the fact it would need precise timing. I want to be able to read the serial port and use the info to affect indicators whilst at the same time acting on any changes by the user to the FP. Does anyone have any pointers/example VIs? Thanks.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.