LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

a little endian question

Solved!
Go to solution

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!

0 Kudos
Message 21 of 28
(861 Views)

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

0 Kudos
Message 22 of 28
(855 Views)

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.

0 Kudos
Message 23 of 28
(851 Views)

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.

0 Kudos
Message 24 of 28
(847 Views)

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.

 

 

0 Kudos
Message 25 of 28
(841 Views)

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

0 Kudos
Message 26 of 28
(833 Views)

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.

0 Kudos
Message 27 of 28
(828 Views)

@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???

0 Kudos
Message 28 of 28
(819 Views)