11-03-2013 08:53 PM
hi altenbach, here is a code i tried with your solution and combined it with serial write and read. I think it should work if I try it with hardware next. but I have a question, If i send a command to check the position of motors in each station in the same way as before, I read back hex strings in little endian that I need to convert it to big endian first and then to decimal number and show it on the front panel when the user wants to check the position of motors. are there better ways to do it? now I'm back to the original little endian question.
Cheers!
11-03-2013 09:21 PM
hi altenbach, is there a way to do your tryFINAL code with event structure instead of while loop so not constantly polling? so as they say 🙂 .. should I put the entire code inside the event structure like this? but it doesn't work. thanks
11-03-2013 09:47 PM - edited 11-03-2013 09:47 PM
The event structure needs to be in a while loop. Then you need to assign the main event to value change events of the critical controls. Also add an event for the stop button.
Look at the shipping examples and design patterns.
11-03-2013 10:51 PM
Thanks altenbach, I will try that. but more importantly, if I want to read the motor position from a text file instead of user input, too. how do i do that? can you please look at my code? what's wrong with it? I want to read decimal numbers from text file as preset positions and then move the motor / thanks.
11-03-2013 11:04 PM - edited 11-03-2013 11:06 PM
I don't think it is useful for you to constantly post incomplete code in tiny increments. Code that show a complete lack of understanding of LabVIEW programming. I would recommend you look at some of the examples that ship with LabVIEW and maybe do some tutorials.
You are generating a 2D array of data, but are trying to reduce the entire mess to a single 5 byte string. Seems pretty meaningless.
Do you want to continuously generate instrument commands, for example one for each row of the 2D array? What shoud the command rate be? What's in the file? You rpbably need a loop and parse each data row in the right way.
11-03-2013 11:33 PM
I want to read these numbers from text file: (sorry I posted a wrong text file before. new text file is attached . these numbers should be read from text file and processed the same way as in the manual mode as in your tryFINAL solution. I want to be able to move motor1 or C1 or LF or HF (whichever name it has) to certain position in increment. I want to move motor1 to 5% , 7.5% , 10.0% and so on like before.but in a sequence. thanks
5.0
7.5
10.0
12.5
15.0
17.5
20.0
22.5
25.0
30.0
35.0
40.0
45.0
50.0
55.0
60.0
65.0
75.0
85.0
95.0
C2_POSITIONS in [%] (0 ... 100)
5.0
7.5
10.0
12.5
15.0
17.5
20.0
22.5
25.0
30.0
35.0
40.0
45.0
50.0
55.0
60.0
65.0
75.0
85.0
95.0
11-03-2013 11:50 PM
actually, I think I best use the open config file and read key VI's to read from that text file.
I just have to figureout how to do it. I need help. thanks.
11-04-2013 12:06 AM
@alex75 wrote:
actually, I think I best use the open config file and read key VI's to read from that text file.
I just have to figureout how to do it. I need help. thanks.
That suggestion makes absolutely no sense, whatsoever. Did you even read the help for the config file tools???