LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

a little endian question

Solved!
Go to solution

Hi there're 8 motors, in 4 groups (Station, adress 12, 22, 32, 42 HEX , one bye) , each group has two motors(LF and HF, address 70 and 7A HEX) , so the address to motor1 (LF) of Station1 woud be 1270 (HEX) and then the next two bytes or 4 byes will be data (how many steps for the motor) and the checksum. why does it not make sense? i need help. in the lower section i tried the read from spreadsheet. is it better to use read from spreadsheet or text file? since the text file is tab deliminated? thanks for your time

0 Kudos
Message 11 of 28
(1,483 Views)

What doesn't make sense is that whoever wrote the description doesn't know the difference between bits and bytes.  And your last message sounds like you aren't so sure either.

 

Don't start throwing in things about Read from Spreadsheet now.  You are bring up another problem when you haven't even solved your first problem.

 

See the attached VI that shows how to do exactly the example in what you posted (as long as you ignore the way words like bit and byte were misused.)

 

There may be more efficient ways to do this.  But these are the literal steps shown in your example.

Message 12 of 28
(1,475 Views)

You are constantly posting basically the same garbage code, which contains 90% too much stuff (e.g. file reading, FOR loop, etc. etc. Can you boil it down to a small example that does exactly what's being discussed. We don't need distractions!

 

Create a small program that composes the string as in the text example posted, given the three inputs:

 

  • station number
  • selection
  • percentage
  • checksum (calculated).

 

Nothing else. This is the first thing you need to be able to do. Lete's not get distracted with all that other stuff.

0 Kudos
Message 13 of 28
(1,474 Views)

altentbach , for one thing, the checksum that I get is C9 , while it should be 27

 

 

Posting endless versions of broken code is not useful unless you tell us exactly what's wrong with it.

0 Kudos
Message 14 of 28
(1,469 Views)

1.  You are adding array elements rather than XORing them.

2.  You forgot the first two bytes of 12 and 70 (hex).

0 Kudos
Message 15 of 28
(1,463 Views)
Solution
Accepted by alex75

Stop the insanity! Try this:

 

 

Message 16 of 28
(1,459 Views)

altenbach, ...  ok, here's another try for what you asked me. I can have 4 of these groups of 2 motors on the fron panel for the user to enter data to each motor separately and move the motors. are there a better and more effiecient way?  but the checksum is still an issue

 

You are constantly posting basically the same garbage code,

0 Kudos
Message 17 of 28
(1,455 Views)

Did you even bother to look at the code I attached above?

 

Why do you have LF and HF linked to their own percentage? Use seperate controls for HF/LF and percentage.

Did you look at Ravens comments? You are still summing instead of XORing. You are not including all bytes in the checksum.

 


@alex75 wrote:

altenbach, ...  ok, here's another try for what you asked me. I can have 4 of these groups of 2 motors on the fron panel for the user to enter data to each motor separately and move the motors. are there a better and more effiecient way?  but the checksum is still an issue


Place the controls for a single motor inside a cluster, then use an array of four such cluster elements.

0 Kudos
Message 18 of 28
(1,453 Views)

altenbach, ... sorry I am behind. I was busy writing that last try5 and posting it while you posted your code; as always, so elegant. works great. Thank you very much. now I shall try connecting it to serial port and try6. 

 

 

Stop the insanity! Try this:

 

Did you even bother to look at the code I attached above?

0 Kudos
Message 19 of 28
(1,446 Views)

Thank you RavensFan for your code. it works great. you're right, that description had error in there.

now can you help me out with the read from text file portion? basically I have a text file that it has  string numbers to be read from. I need to do that to automatically move the motors to 25 different positions, from 100 to 2500 steps in 100 increments, in the auto mode.  should I try that lower portion of try4 code of mine and combine it with altenbach's solution? I hate to post it again, like altenbach said, it is garbage, LOL! ... thanks.

 

What doesn't make sense is that whoever wrote the description doesn't know the difference between bits and bytes.  

 

Don't start throwing in things about Read from Spreadsheet now.  You are bring up another problem when you haven't even solved your first problem.

 

0 Kudos
Message 20 of 28
(1,438 Views)