Apologies if this already exists.
I would like to see simulation only component icons.
The idea being If i want to start a simulation with say Switches 1,4,& 5 out of a total 6 switches pressed & pot1 start at a value of 128
Then we can grab 4 simulation icons and set first 3 to a value of 1, for the three switches and place them at the start.
Then enter 128 for pot1.
so every time simulation is started switches 1 ,4 & 5 read 1 amd pot1 reads 128 until manually changed.
It can be a pain sometimes keep having to set pot asn switched to a prefered state after pressing F8 or single step.
Simulation: Set components to an initial required state
Moderator: Benj
Forum rules
Only feature requests will be considered here. General questions should not be posted in this forum.
Only feature requests will be considered here. General questions should not be posted in this forum.
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
-
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
Re: Simulation: Set components to an initial required state
would be nice to be able to preset the eprom aswell
I have set the contents with write function but didn't appear in eprom on dashboard (I could have done this wrong also)
Steve
I have set the contents with write function but didn't appear in eprom on dashboard (I could have done this wrong also)
Steve
Success always occurs in private and failure in full view.
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Simulation: Set components to an initial required state
Hi Steve,
With EEPROM you can preload with data so it does appear on the console: Martin
With EEPROM you can preload with data so it does appear on the console: Martin
Martin
Re: Simulation: Set components to an initial required state
Hi Medelec,medelec35 wrote:Apologies if this already exists.
I would like to see simulation only component icons.
The idea being If i want to start a simulation with say Switches 1,4,& 5 out of a total 6 switches pressed & pot1 start at a value of 128
Then we can grab 4 simulation icons and set first 3 to a value of 1, for the three switches and place them at the start.
Then enter 128 for pot1.
so every time simulation is started switches 1 ,4 & 5 read 1 amd pot1 reads 128 until manually changed.
It can be a pain sometimes keep having to set pot asn switched to a prefered state after pressing F8 or single step.
There is a way to do this and I have attached two screenshots that I hope help.
For analogue;
Here I use a loop to set the analogue challensl to a mid-point (0.5) for 6 potentiometers. This updates the position graphically also in simulation.
For digital;
Here it doesn't work quite as good. The switch component appears to have been designed not to update visually from the SetPort command. It works in that the values are written, but graphically you can't see, unfortunately. To overcome this I connected a series of LEDs to show which bits of PORTB in this example were set.
I hope these help?
Thanks,
Paul
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Simulation: Set components to an initial required state
Hi Paul,
Thanks.
Although what you have posted is good, If switch looks off but LED is showing on then how is the switch is turned off?
Ideally should be a physical movement.
I would guess if switch is not physically switched on then when component is accessed it would off?
If that is the case then the suggested way unfortunately would not help.
Also, I can't seem to get portB to 255?
Not sure if entered correctly as visually comparing with an image, rather than copy and pasting.
What I have done in the simulation Code (Assuming that's how commands are entered?)is:
test=::Connection.SetPort("PORTB",0xff,0xffffffff)
&
test=::Connection.GetPort("PORTB",0xffffffff)
Martin
Thanks.
Although what you have posted is good, If switch looks off but LED is showing on then how is the switch is turned off?
Ideally should be a physical movement.
I would guess if switch is not physically switched on then when component is accessed it would off?
If that is the case then the suggested way unfortunately would not help.
Also, I can't seem to get portB to 255?
Not sure if entered correctly as visually comparing with an image, rather than copy and pasting.
What I have done in the simulation Code (Assuming that's how commands are entered?)is:
test=::Connection.SetPort("PORTB",0xff,0xffffffff)
&
test=::Connection.GetPort("PORTB",0xffffffff)
Martin
Martin
Re: Simulation: Set components to an initial required state
Hi Martin,
I know it's not ideal, so apologies. It seems that it's just a visual thing with the switch not changing graphically. If you use SetPort, and then use a component macro to read the switch it will return a '1', even though graphically it hasn't updated (see screenshot).
As for writing 255 to PORTB, it is working fine for me. What chip are you using? Is PORTB a full port?
We would have to re-work the switch component to achieve the graphical representation, so I will enquire about that and see what we can do.
Thanks,
Paul
I know it's not ideal, so apologies. It seems that it's just a visual thing with the switch not changing graphically. If you use SetPort, and then use a component macro to read the switch it will return a '1', even though graphically it hasn't updated (see screenshot).
As for writing 255 to PORTB, it is working fine for me. What chip are you using? Is PORTB a full port?
We would have to re-work the switch component to achieve the graphical representation, so I will enquire about that and see what we can do.
Thanks,
Paul
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Simulation: Set components to an initial required state
Hi Paul,
No need for apologies as it is very interesting and will most definitely come in handy!
Especially I have got it to work now.
When I posted the previous post, I was setting it up wrong.
Will be using your method in the future.
Of course I will still like to see the switch move so to turn off a I/p you need to turn switch on then back off.
But this is the nest best thing.
Thank you.
Martin
No need for apologies as it is very interesting and will most definitely come in handy!
Especially I have got it to work now.
When I posted the previous post, I was setting it up wrong.
Will be using your method in the future.
Of course I will still like to see the switch move so to turn off a I/p you need to turn switch on then back off.
But this is the nest best thing.
Thank you.
Martin
Martin