11-03-2013 06:34 PM
Hi altenbach, ... 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
11-03-2013 06:47 PM - edited 11-03-2013 07:03 PM
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.
11-03-2013 06:48 PM - edited 11-03-2013 06:49 PM
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:
Nothing else. This is the first thing you need to be able to do. Lete's not get distracted with all that other stuff.
11-03-2013 07:00 PM - edited 11-03-2013 07:03 PM
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.
11-03-2013 07:05 PM
1. You are adding array elements rather than XORing them.
2. You forgot the first two bytes of 12 and 70 (hex).
11-03-2013 07:11 PM
11-03-2013 07:29 PM
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,
11-03-2013 07:31 PM - edited 11-03-2013 07:37 PM
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.
11-03-2013 07:47 PM - edited 11-03-2013 07:49 PM
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?
11-03-2013 08:14 PM - edited 11-03-2013 08:15 PM
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.