Pm3 Csafe State Machine
I'm having some trouble understanding and controlling the CSAFE state machine on the PM3. I'm also not sure how critical or accurate the states are when applied to individual rowing screens. I appologize if this is too long or not in a usable format, but if you have any questions or need more information just ask away! Everything below is from my observation of the PM3 using CSAFE, even if I state something as fact, it may only be true based on the conditions of my testing.<br /><br />Hardware: Model D, PM3, FW:970<br />Platform: WinXP / OS X 10.3<br /><br />1: flgAck is not enabled on FW 970.<br />Any commands sent to the rower without explicit return data do not return any packets. Good examples are all of the state transition commands (CSAFE_RESET_CMD, CSAFE_GOREADY_CMD, etc). Page 18 of the documentation says that flgAck is enabled and unchangeable. I didn't try using the CSAFE_AUTOUPLOAD_CMD because no flags can be changed and the docs claim it has no effect. This is reproducable through the SDK demo application, sending the frame: "0xF0 0xFD 0x00 0x87 0x87 0xF2" (CSAFE_GOREADY_CMD) causes the ReadFile to timeout.<br /><br />2: Exiting a "Just Row" session does not trigger a transition from the OFFLINE state.<br />If you pull the chain and start a workout, the PM3 properly moves into the offline state. Pressing the MENU/BACK button returns you to the PM3 menu screen, but the rower stays in the offline state and doesn't transition to READY. The only way to exit the offline state is to use the PM3 buttons to start a workout and then exit THAT workout using MENU/BACK. I couldn't find any CSAFE command that could trigger a transition from offline - not even CSAFE_RESET_CMD. It seems that RESET should reset the state machine even in the offline mode, but I can understand if the interactive user is given preference over the CSAFE master.<br /><br />3: The IDLE state transitions are not working.<br />I haven't been able to get the PM3 to transition from IDLE to either the HAVEID or INUSE states using CSAFE. Once the IDLE state is entered, the PM3 stays there until the user enters a number or presses the MANUAL button. I can't say for sure what state the PM3 transitions to after these UI events, because I didn't check it. From my testing, it certainly is not possible to bypass this input screen using CSAFE_GOHAVEID_CMD.<br /><br />4: The CSAFE_SETPROGRAM_CMD causes a screen change, but no state transition.<br />Is there no correlation between the rowing screen and the INUSE state? I thought that setting up a workout would be contained under the 'Master sends configuration' section of the CSAFE flow chart, but when the command completes the rower is put into a 'ready to row' state and pulling on the chain begins the workout. Checking the status flag after sending the command shows that the INUSE state hasn't been entered. I was sending this command from the READY state and the PM3 was still in the READY state after the rowing screen appeared. I didn't check to see if there was a transition once I started rowing. Are the workout programs intended to be sent while the rower is in the INUSE state? Or should sending the program data cause a transition?<br /><br /><br />That's it for now. Again, sorry for the length. I haven't fully explored the state machine yet, as it took me most of last night to figure out the states leading up to INUSE. I haven't spent any time looking at the transitions leaving INUSE or MANUAL. All in all, these might be irrelevant or they might just be my misunderstanding of how the states affect the PM3.<br /><br />Mike<br />
I'm going to follow up to my own post as I have some more info. Now that I have an app that is properly reading and reporting the state it's a lot easier to watch the PM3 in action. My confusion really stems from what's reported on the screen vs. what's reported in the status byte.<br /><br />I'm still sure that the flgAck is not set, but as far as state transitions go:<br /><br />1: The PM3 has a tendency to get 'stuck' in the Offline mode. <br />It can be caused by JustRow's or selected workouts. When the user ends the offline workout using Menu/Back, the PM3 reports 'Ready' for 1-2 seconds and then falls back into the OffLine state. I've found no way to exit 'OffLine' once that starts happening, short of physically reseting the PM3. It may return to 'Ready' if I were to row a complete workout.<br /><br />2: The IDLE state transitions are almost all working.<br />Sending a CSAFE command when in idle mode doesn't cause the monitor to change screens. The PM3 properly transitions to 'HaveID' or 'InUse' behind the scenes, but the screen is still accepting user input. Once that screen is displayed, I can't get the PM3 to do anything else. Also, pressing the 'Manual' button doesn't cause a transition into the 'Manual' state, although it does return to the main menu. <br /><br />If I use the CSAFE flow chart to get the PM3 into 'InUse', the PM3 doesn't response to my SET_PROGRAM command and I can't start working out.<br />[Ready] > [GoIdle] >[Idle] > [GoHaveID] > [HaveID] > [GoInUse] > [InUse] > [Set Program]<br /><br />I can get what seems to be a working behavior by doing the following, but this isn't shown as 'allowed' on the flow chart:<br />[Ready] > [GoInUse] > [InUse] > [Set Program]<br /><br />At which point, the PM3 properly stays in the 'InUse/Paused' state while rowing. If I use Menu/Back to cancel the workout, the PM3 transitions to 'OffLine' and I get stuck again.<br /><br /><br /><br />As I keep working on this, I may find less and less 'strange' behavior and it may turn out to all be due to my misunderstanding of how the CSAFE flow chart applies to the PM3. Hopefully any discussion on CSAFE states will help other developers who are just getting started like me.<br /><br />Mike<br />
-
- Posts: 0
- Joined: March 18th, 2006, 10:32 pm
-
- Posts: 0
- Joined: March 18th, 2006, 10:32 pm
Hi Mike<br /><br />I can not help you too much because I am still learning how it works<br /><br />In my experiences, I can not start a workout, the monitor shows the<br /><br />workout but it never starts, I tried to combine with "goready" but it doesn't help...yet<br /><br />I am meaning it occurs because the monitor is not connected to the rower<br />I think so, because manually I could not start a 30min workout neither<br /><br />Somewhere for sure is the start button that I still don't find<br /><br />This week after my online workouts I will mount the monitor ( I hope I can dismount it easy again) to test the behaivor better<br /><br />Another thing I miss is that I can not block the monitor, analog the PM2<br />I can block the PM2 but not the PM3. Anyway the documentation is very complete<br />Maybe I find the explanation somewhere<br /><br />I found the issue about the date in the documentation too (thanks for your help)<br /><br />Marilyn<br />
<!--QuoteBegin-Simon (Fitronics)+Mar 9 2005, 04:52 AM--><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><div class='genmed'><b>QUOTE(Simon (Fitronics) @ Mar 9 2005, 04:52 AM)</b></div></td></tr><tr><td class='quote'><!--QuoteEBegin-->Try setting your program after getting the ID and before sending go in use - this would be the more normal order for CSAFE. <br /> </td></tr></table><br /><br />Simon,<br /><br />Thanks for the response and input.<br /><br />Your order seems to make sense to me in terms of a piece of equipment in a gym. The machine sits in the idle state until someone sits down and punches in their ID, at which point it transitions from idle and the master configures the machine based on their current plan/workout/etc. This works for me both practically and technically.<br /><br />I'd still like to see a working computer-controlled scenario, where using the GO_HAVEID command removes the ID entry screen and allows you to program the workout without requiring the user to input an ID. I'd also like to see GO_FINISHED cause the PM3 to return to the main menu screen, and I'd like the Menu/Back button to transition back to the ready state when the user exits a workout. I guess it's how the screens are tied to the CSAFE states that both confused me initially and also prevents me from tightly coupling the states to my application. <br /><br />Am I wrong in thinking that I should be able to examine the CSAFE state to figure out if a user cancelled a workout using the buttons on the monitor?<br /><br />Mike
-
- Posts: 0
- Joined: March 18th, 2006, 10:32 pm
<!--QuoteBegin--><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><div class='genmed'><b>QUOTE</b></div></td></tr><tr><td class='quote'><!--QuoteEBegin-->I'd still like to see a working computer-controlled scenario, where using the GO_HAVEID command removes the ID entry screen and allows you to program the workout without requiring the user to input an ID. I'd also like to see GO_FINISHED cause the PM3 to return to the main menu screen, and I'd like the Menu/Back button to transition back to the ready state when the user exits a workout. I guess it's how the screens are tied to the CSAFE states that both confused me initially and also prevents me from tightly coupling the states to my application. <br /> </td></tr></table><br /><br />I am looking too for a working computer-controlled scenario<br />In a workout is it not a problem if the user must click or must begin to row to start<br />the workout but not in a race!<br />In a race everybody start at the same time, the race should be controlled by the computer and not by the user<br />It has to be a way to start the workout without intervention of the user<br /><br /><br />Marilyn