10-20-2013 08:54 AM
Hi all,
Seeking for help with the following questions
10-20-2013 09:04 AM
welcome to forum
If i am not wrong this is your homework.
you have a lot of resources LabVIEW help, basic 1, basic 2 , introduction courses where you can learn all of these.
Now the best thing you did you have seen the forum very early, but try to learn all these youself and if you have any specific problem give it a try and show everyone here.
So start learning and enjoying the world of programming
10-20-2013 10:03 AM - edited 10-20-2013 10:04 AM
#6 is poorly worded English, doesn't even make sense. And they should have capitalized "For Loops" so it was clear it was talking about the named structure. When I first read it, considering the English was so bad, the word "for" blended in and it looked like they were just talking about loops.
10-20-2013 10:07 AM
is it true that you you should not use a 'for loops' in data acquisition? I did not know that.
because I am having that same problem right now and I cannot write to serial port in a for loop and always get a 'NAK'
is that the reason? should I try a while loop?
I can write the individual commands to serial port, but not in a for loop. why is that? please help. thanks
10-20-2013 10:13 AM
No, it is not true that you shouldn't use a For Loop for data acquisition. Typically, you don't, but I wouldn't say you're not supposed to.
Two things stand out to me in your screenshot.
1. You have a 20 millisecond wait. Are you sure that is enough time between writing the command, and reading the port.
2. You are sending a carriage return for your termination character on writing the command. Are you sure that is correct? Is it possible it should be a new line/linefeed character?
10-20-2013 10:31 AM
For loops will iterate a fix number of times so if you want continious data aquisition you should use while loop.
10-20-2013 10:41 AM
Hi... yes, the individual commands work one by one when I use a case stucture and an enum,
I always get a ' > ' and the the desired result, but not in a "For Loop'.
also as you can see, I have some trouble changing the strings from serial read to number at the end too and I get 0 in numeric indicator. why?
for example if i get the string of: 25.15,45.92 from serial read buffer, I want to show it on two numeric indicators on the front panel, that one shows 25.15 and the other shows 45.92
how do I do that?. thanks
10-20-2013 10:47 AM
Yes, I want a fixed number of measurement too, like: 10 measurements.
I actually need to add network analyzer's commands in the for loop too, to take the measurement at those ten intanses. are you saying 'For Loop' is not good for 10 measurements in a sequence?
10-20-2013 11:03 AM
dont be confuse about For loop.
OK you want 10 different values use a For loop. As you said things are working when you are using case structure and enum you are getting the responce you will get this with For loop also.
instead of showing different values in different indicator show them in an array where each element contains a single read value.
collect strings in For loop and type cast it afterwards
10-21-2013 10:41 AM
@Neos wrote:
.....
collect strings in For loop and type cast it afterwards..
Don't use typecast, it won't work for this. Use Scan From String, which can be found on the String palette, or one of the String To Number functions.
MC