LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

i want to convert string to 1-D array to input it to waveform graph?

hi
spreed sheet by default out 2D-ARRAY how i can make it out 1D array
if u suggest array type block
tell me how i can do that by using it
thanks alot

0 Kudos
Message 11 of 18
(1,210 Views)

Hi oi,

 

"spreed sheet by default out 2D-ARRAY how i can make it out 1D array"

You already say it: when the default type is a 2D array you have to change the input for the data type!!!

 

"tell me how i can do that"

Create a new array constant of the required type...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 18
(1,205 Views)

 


@ChrissyC87 wrote:

 


@oiuuhjoi wrote:

 

the spreadsheet string array onla accepts 2D array.


To make the function accept a 1-D array you have to wire a 1-D string array constant to "Array Type". 

 

 


 Posted only a minute before your question, sorry if you didn't see it in time.

 

-CC 

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 13 of 18
(1,202 Views)

i change array diemensional to 1D array
but
it is query error and no graph appear

0 Kudos
Message 14 of 18
(1,193 Views)

Your string doesn't contain any data that would be considered a 1-D array.  It is just a single piece of data.

 

You need to use Scan from String to pick out the numeric value in it.  Then you need to either feed that data to a Waveform Chart.  Or to feed it into a Waveform Graph, you need to use Build Array and either a feedback node or shift register.

 

How come your VI doesn't have a while loop?  Right now it only runs once then stops.

0 Kudos
Message 15 of 18
(1,185 Views)

Based on the string that is shown, your conversion to a 1D array is incorrect. You have a single value in that string and even if was converted correctly, you have point style set to none and with 1 point, no lines connecting them. Your code just does not make any sense as it is. If you are getting a different string than what is shown, save the VI with that default value. If the string is correct, use Scan From String to get a scalar and write to a chart.

0 Kudos
Message 16 of 18
(1,187 Views)

Right first things first:

 

  1. you need to put the read/write VISA functions in a loop if you intend to read from your serial port continously (don't use the run continously button -it's for debugging only!)
  2. you need to make sure that you connect up all of your errors - this makes debugging much, much easier
  3. you need to close the reference to your serial port at the end of your program (after your new while loop) - otherwise you'll leave the port open after your program has finished which this will cause problems.

A good idea would be to read the basic Labview tutorials and/or have a look at the examples that ship with LabVIEW (particularly the basic serial read write.vi)

 

If you want the graph to update with your serial reads then it needs to be inside the loop and changed to a "waveform chart"

 

-CC 

 

[edit: sorry for repeating Ravens and Dennis's points - he lieth the danger of nipping off for a cuppa midway through a reply! Smiley Wink]

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 17 of 18
(1,181 Views)

hi

sorry for being Obtrusive. 😄
but im not good in using labview and i need to do this work  essentialy.
thats what i understand to do
1- i will make while loop
2-put scan from string block
3-connect s-parameters string to input string (in scan from string)
4-write %f to format string (in scan from string)

5-take out to waveform graph(error occure)??

0 Kudos
Message 18 of 18
(1,172 Views)