I've created a configuration which bricks my device.
- Brzeski
- Posts: 8
- Joined: Fri Jun 24, 2011 3:22 pm
I've created a configuration which bricks my device.
I was following an example posted for creating a timing loop which increments a variable when a button is pressed and then after 5 seconds decrements it (Marcio.db3 was the file I downloaded, but can't seem to find in the the boards at the moment).
What I was trying to do was to follow most of the logic there and create a simple set of logic to continuously increment a variable every time I pressed a button. In doing so I created a configuration which bricks my PV750 device. The PV750 boots, but then gets stuck at the standard Murphy loading screen. I'm not worried so much about the device as I have extras on hand, but I want someone smarter than I with the Config tool to take a look so I don't make that mistake again.
Attached is the .db file which caused my crash. I did make a change which appears to have fixed my issue which was removing the CCM->Event in the Incriment, Initial state (pardon the spelling errors).
Also, if someone could comment on the increment logic that would be appreciated.
Thanks.
What I was trying to do was to follow most of the logic there and create a simple set of logic to continuously increment a variable every time I pressed a button. In doing so I created a configuration which bricks my PV750 device. The PV750 boots, but then gets stuck at the standard Murphy loading screen. I'm not worried so much about the device as I have extras on hand, but I want someone smarter than I with the Config tool to take a look so I don't make that mistake again.
Attached is the .db file which caused my crash. I did make a change which appears to have fixed my issue which was removing the CCM->Event in the Incriment, Initial state (pardon the spelling errors).
Also, if someone could comment on the increment logic that would be appreciated.
Thanks.
- Attachments
-
- Brzeski-Brick.db3
- (8.3 MiB) Downloaded 12 times
- ksaenz
- Enovation Controls Development
- Posts: 263
- Joined: Thu Aug 19, 2010 7:53 am
Re: I've created a configuration which bricks my device.
Hello Brzeski,
You did fix the issue by removing the "CCM->Fire Event(IncrimentInitial to Count)" from the initial state in the Incriment state machine.
What you have there is an out-of-control loop; when you enter IncrementInitial you fire an event to go to Count, and when you enter Count you fire an event to go back to IncrementInitial and it never stops.
Removing the event from the initial state prevents the loop from going out of control and the state machine still works because you fire that event by pressing a button.
Regards,
ksaenz
You did fix the issue by removing the "CCM->Fire Event(IncrimentInitial to Count)" from the initial state in the Incriment state machine.
What you have there is an out-of-control loop; when you enter IncrementInitial you fire an event to go to Count, and when you enter Count you fire an event to go back to IncrementInitial and it never stops.
Removing the event from the initial state prevents the loop from going out of control and the state machine still works because you fire that event by pressing a button.
Regards,
ksaenz
- Brzeski
- Posts: 8
- Joined: Fri Jun 24, 2011 3:22 pm
Re: I've created a configuration which bricks my device.
kseanz,
On to my next question. I would have expected that logic to continue incrementing the variable every time I press the button, but it only increments once, from 0 -> 1 but does not increment further.
Thanks.
Edit: I was able to fix my problem by changing the logic from just +1, to "User.Increment"+1. So now it operates at designed.
On to my next question. I would have expected that logic to continue incrementing the variable every time I press the button, but it only increments once, from 0 -> 1 but does not increment further.
Thanks.
Edit: I was able to fix my problem by changing the logic from just +1, to "User.Increment"+1. So now it operates at designed.
- ksaenz
- Enovation Controls Development
- Posts: 263
- Joined: Thu Aug 19, 2010 7:53 am
Re: I've created a configuration which bricks my device.
Hello Brzeski,
Change you calculation event "Calculate User.Incriment"
from:
to:
Regards,
ksaenz
Edit: I didn't notice you had already solved your problem. I'm glad to hear your configuration is now working as expected.
Change you calculation event "Calculate User.Incriment"
from:
Code: Select all
+1
Code: Select all
"User.Incriment"+1
ksaenz
Edit: I didn't notice you had already solved your problem. I'm glad to hear your configuration is now working as expected.
- Brzeski
- Posts: 8
- Joined: Fri Jun 24, 2011 3:22 pm
Re: I've created a configuration which bricks my device.
ksaenz,
Yeah I figured I would try something else while I was waiting for a response.
I'm now trying to configure the device to send a CAN message when a button is pressed. So far I copied most of the code for the Increment loop, but when it comes to sending the CAN message, I don't appear to have any output. I'd also like to display the data from a CAN message as another step in my introduction to the PV750. What is the best method for creating this type of logic?
So far for the receive part, I haven't been able to pull up any data. I have a system variable set up in the database, I have a FreeForm CAN message created under the right CAN port (with correct settings as far as I can tell), and I have the Screen set to pull the variable.
Any advice? or do you have an example of creating free form CAN messages anywhere on the boards?
Thanks,
Yeah I figured I would try something else while I was waiting for a response.
I'm now trying to configure the device to send a CAN message when a button is pressed. So far I copied most of the code for the Increment loop, but when it comes to sending the CAN message, I don't appear to have any output. I'd also like to display the data from a CAN message as another step in my introduction to the PV750. What is the best method for creating this type of logic?
So far for the receive part, I haven't been able to pull up any data. I have a system variable set up in the database, I have a FreeForm CAN message created under the right CAN port (with correct settings as far as I can tell), and I have the Screen set to pull the variable.
Any advice? or do you have an example of creating free form CAN messages anywhere on the boards?
Thanks,
- ksaenz
- Enovation Controls Development
- Posts: 263
- Joined: Thu Aug 19, 2010 7:53 am
Re: I've created a configuration which bricks my device.
Brzeski,
Do you want to send the CAN messages at a fixed rate or only when you press the button?
If you can want to send the message at a fixed rate I suggest you use the Transmit Device under one of the CANports in Environment Setup.
If you only want to send the message when you press a button you are going to have to set up a Free Form CAN message in one the CANPorts in Environment Setup.
To display incoming data you need to add Parameter mappings to a J1939 device under one of the CANports in Environment Setup.
You can find more information these features in the Configuration Tool Manual:
viewtopic.php?f=14&t=38
You can also look at one of the Murphy Standard Configurations included in the Configuration Tool to see those features in action.
If you are just getting started with the Configuration Tool I invite you to come to one of our classes. Contact your Murphy representative for more information.
Regards,
ksaenz
Do you want to send the CAN messages at a fixed rate or only when you press the button?
If you can want to send the message at a fixed rate I suggest you use the Transmit Device under one of the CANports in Environment Setup.
If you only want to send the message when you press a button you are going to have to set up a Free Form CAN message in one the CANPorts in Environment Setup.
To display incoming data you need to add Parameter mappings to a J1939 device under one of the CANports in Environment Setup.
You can find more information these features in the Configuration Tool Manual:
viewtopic.php?f=14&t=38
You can also look at one of the Murphy Standard Configurations included in the Configuration Tool to see those features in action.
If you are just getting started with the Configuration Tool I invite you to come to one of our classes. Contact your Murphy representative for more information.
Regards,
ksaenz
- Brzeski
- Posts: 8
- Joined: Fri Jun 24, 2011 3:22 pm
Re: I've created a configuration which bricks my device.
ksaenz,
For now, just every button press.
I've setup a FF CAN message, like the Config Tool Manual suggests, but I don't see any outgoing CAN message on my CAN analyzer device.
I'm confident the hardware is configured correctly, because I do see the PV750 broadcast what I can assume is a 'boot-up' CAN message, plus if I use my CAN analyzer device to broadcast a general CAN message with the PV750 off I get an Error message (although I haven't gotten it to display on the PV750, it seems to acknowledge the message).
I have the CAN Message configured in the Environment Database and assigned to a variable, in the System Variable database I have it defined with a Calculation Event, and the Programming section I have a state fire off the event just like the Increment code, but no dice.
I've attached my config, any tips would be appreciated.
Thanks.
For now, just every button press.
I've setup a FF CAN message, like the Config Tool Manual suggests, but I don't see any outgoing CAN message on my CAN analyzer device.
I'm confident the hardware is configured correctly, because I do see the PV750 broadcast what I can assume is a 'boot-up' CAN message, plus if I use my CAN analyzer device to broadcast a general CAN message with the PV750 off I get an Error message (although I haven't gotten it to display on the PV750, it seems to acknowledge the message).
I have the CAN Message configured in the Environment Database and assigned to a variable, in the System Variable database I have it defined with a Calculation Event, and the Programming section I have a state fire off the event just like the Increment code, but no dice.
I've attached my config, any tips would be appreciated.
Thanks.
- Attachments
-
- Brzeski-CAN_Example.db3
- (8.32 MiB) Downloaded 8 times
- Brzeski
- Posts: 8
- Joined: Fri Jun 24, 2011 3:22 pm
Re: I've created a configuration which bricks my device.
ksaenz,
For now, just every button press.
I've setup a FF CAN message, like the Config Tool Manual suggests, but I don't see any outgoing CAN message on my CAN analyzer device.
I'm confident the hardware is configured correctly, because I do see the PV750 broadcast what I can assume is a 'boot-up' CAN message, plus if I use my CAN analyzer device to broadcast a general CAN message with the PV750 off I get an Error message (although I haven't gotten it to display on the PV750, it seems to acknowledge the message).
I have the CAN Message configured in the Environment Database and assigned to a variable, in the System Variable database I have it defined with a Calculation Event, and the Programming section I have a state fire off the event just like the Increment code, but no dice.
I've attached my config, any tips would be appreciated.
Thanks.
For now, just every button press.
I've setup a FF CAN message, like the Config Tool Manual suggests, but I don't see any outgoing CAN message on my CAN analyzer device.
I'm confident the hardware is configured correctly, because I do see the PV750 broadcast what I can assume is a 'boot-up' CAN message, plus if I use my CAN analyzer device to broadcast a general CAN message with the PV750 off I get an Error message (although I haven't gotten it to display on the PV750, it seems to acknowledge the message).
I have the CAN Message configured in the Environment Database and assigned to a variable, in the System Variable database I have it defined with a Calculation Event, and the Programming section I have a state fire off the event just like the Increment code, but no dice.
I've attached my config, any tips would be appreciated.
Thanks.
- Attachments
-
- Brzeski-CAN_Example.db3
- (8.32 MiB) Downloaded 8 times
- ksaenz
- Enovation Controls Development
- Posts: 263
- Joined: Thu Aug 19, 2010 7:53 am
Re: I've created a configuration which bricks my device.
Brzeski,
Very good, now that you set up the FF CAN message you need to execute an action to send it.
Looks like the best moment to execute the action is on entering the state SendCanMsg, after it excutes the action:
CCM->Fire Event(Calculate User.SendCanMsg)
add the action:
J1939->Tx Ext Free Form(FFCAN.SendCanMsg)
Regards,
ksaenz
Very good, now that you set up the FF CAN message you need to execute an action to send it.
Looks like the best moment to execute the action is on entering the state SendCanMsg, after it excutes the action:
CCM->Fire Event(Calculate User.SendCanMsg)
add the action:
J1939->Tx Ext Free Form(FFCAN.SendCanMsg)
Regards,
ksaenz
- Brzeski
- Posts: 8
- Joined: Fri Jun 24, 2011 3:22 pm
Re: I've created a configuration which bricks my device.
kseanz,
Excellent, that works. On to part 2.
First, I'd like to transmit the Increment counter when I press my Send CAN Msg button. I initially tried adding this to the calculation: "User.SendCanMsg"="User.Increment" but that doesn't seem to work. The CAN analyzer tool just sees 0's.
Secondly, I'm trying to receive a periodic CAN message sent from the analyzer. I have the variable configured in the CANPort1 with its respective variable, then configured that variable in the database (does it need a calculation?), and then tied the variable to a simple display on the screen. But when I send the appropriate message my screen display stays at 0. The previous config shows this logic. What am I missing?
Thirdly, what part of the transmit actions are actually required? In a newer configuration, I deleted the CCM->Fire Event(Calculate User.SendCanMsg) and I still see the message output. I take it that part was extraneous logic?
Thanks.
Excellent, that works. On to part 2.
First, I'd like to transmit the Increment counter when I press my Send CAN Msg button. I initially tried adding this to the calculation: "User.SendCanMsg"="User.Increment" but that doesn't seem to work. The CAN analyzer tool just sees 0's.
Secondly, I'm trying to receive a periodic CAN message sent from the analyzer. I have the variable configured in the CANPort1 with its respective variable, then configured that variable in the database (does it need a calculation?), and then tied the variable to a simple display on the screen. But when I send the appropriate message my screen display stays at 0. The previous config shows this logic. What am I missing?
Thirdly, what part of the transmit actions are actually required? In a newer configuration, I deleted the CCM->Fire Event(Calculate User.SendCanMsg) and I still see the message output. I take it that part was extraneous logic?
Thanks.
- ksaenz
- Enovation Controls Development
- Posts: 263
- Joined: Thu Aug 19, 2010 7:53 am
Re: I've created a configuration which bricks my device.
Brzeski,
In a calculation event the left side of the formula is implied and the result of the expression is always stored in the variable to which the calculation event belongs. That means that the expression:
is really a comparison and it will return 0 or 1.
For the received message my guess is that the Frame ID doesn't match, seems like a very small number. Are you working with J1939 CAN, CANOpen or some other proprietary protocol?
To send the message you just need:
J1939->Tx Ext Free Form(FFCAN.SendCanMsg)
The calculation event:
CCM->Fire Event(Calculate User.SendCanMsg)
just changed the value in the variable.
Regards,
ksaenz
In a calculation event the left side of the formula is implied and the result of the expression is always stored in the variable to which the calculation event belongs. That means that the expression:
Code: Select all
"User.SendCanMsg"="User.Increment"
For the received message my guess is that the Frame ID doesn't match, seems like a very small number. Are you working with J1939 CAN, CANOpen or some other proprietary protocol?
To send the message you just need:
J1939->Tx Ext Free Form(FFCAN.SendCanMsg)
The calculation event:
CCM->Fire Event(Calculate User.SendCanMsg)
just changed the value in the variable.
Regards,
ksaenz
- Brzeski
- Posts: 8
- Joined: Fri Jun 24, 2011 3:22 pm
Re: I've created a configuration which bricks my device.
ksaenz,
What is the correct expression to evaluate another variable then? I tried simply "User.SendCanMsg" and User.SendCanMsg, etc, to no avail.
You were correct on the Frame ID part, for some reason I had to specify a hex value for the frame ID although the environment was configured for hex!
Thanks.
What is the correct expression to evaluate another variable then? I tried simply "User.SendCanMsg" and User.SendCanMsg, etc, to no avail.
You were correct on the Frame ID part, for some reason I had to specify a hex value for the frame ID although the environment was configured for hex!
Thanks.
- ksaenz
- Enovation Controls Development
- Posts: 263
- Joined: Thu Aug 19, 2010 7:53 am
Re: I've created a configuration which bricks my device.
Brzeski,
The expression depends on what result you want.
If you want "User.SendCanMsg" = "User.Increment" you type:
If you want "User.SendCanMsg" = "User.SendCanMsg" + 1 you type:
Regards,
ksaenz
The expression depends on what result you want.
If you want "User.SendCanMsg" = "User.Increment" you type:
Code: Select all
"User.Increment"
Code: Select all
"User.SendCanMsg" + 1
ksaenz
- Brzeski
- Posts: 8
- Joined: Fri Jun 24, 2011 3:22 pm
Re: I've created a configuration which bricks my device.
Ah, there we go.
I removed the CCM-> Fire Event(Calculate User.SendCanMsg) because I didn't think it was needed for the sending part, but I see the calculation is needed to evaluated the expression! Once I put that back, it now works as I expected.
So the other lesson learned is that there is functionally an '=' to the left of the expression that isn't shown when I create a Calculation Event in the System Variables Database.
Thanks.
I removed the CCM-> Fire Event(Calculate User.SendCanMsg) because I didn't think it was needed for the sending part, but I see the calculation is needed to evaluated the expression! Once I put that back, it now works as I expected.
So the other lesson learned is that there is functionally an '=' to the left of the expression that isn't shown when I create a Calculation Event in the System Variables Database.
Thanks.