08-02-2007 09:18 AM
Sorry, I made the change to the case statement before I noticed you had the incorrect value. It should be 3F.
You only need two cases. One for 3F and another one set to default. This can just have the value 0. You would only need other cases if you wanted to do something unique in each case.
08-02-2007 09:22 AM
08-02-2007 09:28 AM
08-02-2007 09:43 AM - edited 08-02-2007 09:43 AM
VR6Fidelity wrote:
Now if I Send 63, the request values command it goes like this.
1. I send the 63 command2. it says ack3. It sends me data4. I reply ACK to let it know I got the data.
It still looks like you are missing step #4 in your case structure in your version 10.
You had also said it took a long time to run (I assume when the other errors were causing problems). That is caused by your 10 sec. timeout in the initial serial port setup VI.
Message Edited by Ravens Fan on 08-02-2007 10:46 AM
08-02-2007 09:47 AM
@Vr6Fidelity wrote:
... I used the semi-rube setup.
Or you could just branch off the "type" enum and make the cases the same as in the first case structure. 🙂
This will make the code easier to read because everything depends on the same primary value. RIght now, the second case depends on the first case in a complex way that might be hard to understand in a few months. [If type=timeout -> value =xxx --> if value=xxx, do yyy] vs. [ if type=timeout -> value=xxx AND also do yyy later.]
From your program logic, there shouldn't be any bytes at the port unless we had a timeout case condition. You could just check if the number of bytes at the ports is zero or not for the second case structure.
08-02-2007 09:48 AM
08-02-2007 10:48 AM
08-02-2007 11:28 AM
08-02-2007 01:08 PM
So I spun the motor! Woo hoo!
However, whatever you type in for speed, the motor spins at 32,000 regardless of the value you type in?
I did some probing: i type in 20,000 and the first 1 byte is "7" and the second byte is "208"
These do not seem to be HEX values.
08-02-2007 01:27 PM