PE6 : How to interface the simulator with another application ?

Buzby

Senior Member
Hi,

I'm simulating code for a project which involves the mathematical representation of locations in a 2D space using polar coordinates. The finished device will not have any display relating to the coordinates, just a Yes/No result.

It's a real pain in the a**e trying to visualise what the coordinates represent when they are changing, so I wrote a little VB programme to display the relevant vectors and positions in real-time polar fashion.

The VB is written to use a com port to accept input from a serout or similar, but this means I need to run the PICAXE code on a real chip.

I'm not able at the moment to run on a real chip, and even if I was, I would still like to prove my code before building the hardware.

I asked before about how to get the simulator talking to another application ( http://www.picaxeforum.co.uk/showthread.php?23078-Access-to-PE-variables-from-DDE-or-OLE-Client ), and was informed that PE6 would have 'named pipes' to perform this function.

I'm fairly sure these 'pipes' are what PE6 uses to drive the simulation of Rudolph and co., but I can't find any information on how to use them.

Is there any documentation available showing how to use these 'pipes' ?

Cheers,

Buzby
 

Buzby

Senior Member
I'm fairly sure these 'pipes' are what PE6 uses to drive the simulation of Rudolph ....
Well, I was right.

The link between PE6 and Rudolph is a pipe called "picaxe-AXE107", and the one for the Dice is called "picaxe-AXE105".
The pipe server appears to be in the relevant simulation, not PE6, so now I just have to work out how to make my own.
I think my next step is to sniff what's in these pipes. I'm not a Windows programmer, so it's a wobbly learning curve.

It would be so much easier if there was a document somewhere giving examples.

Cheers,

Buzby
 
I don't think , you can just sniffing and see what 's going on.
You have already know , how pipe is working.

And then , when you are a good Windows programmer you may see this :
pipe.png
 
sadly , to date , no informations from Education Rev. will go out.
I self have made a simulation and a Wizard for a 16x2 LCD-Display with these few infos.

In Germany , many user are waiting of the command List for the pipe to programm any simulations.
 

Technical

Technical Support
Staff member
This is still in an experimental stage and we are working dynamically with a few partners such as Webots to build complex examples to test the protocol. So in summary the protocol has not yet been finalised or released. However it is looking quite stable at present so it shouldn't be too long now before publication.
 

Buzby

Senior Member
PE6 is still Beta, so could we not have a Beta release of the protocol ?.

I don't need a complex example, just a simple one will do.
 
Thanks for the PDF , but ..... all the informations are renowned :(

With this few commands I ' ve made already in may a plugin for a 16x2 LCD Display e.g.

What's about I²C .... Irin , Irout , ... SPI ?
 

Technical

Technical Support
Staff member
PE6 is not designed for this type of advanced protocol simulation.
If you want to simulate i2c/spi etc you need to use the 'PICAXE VSM' SPICE simulator instead.
 

Buzby

Senior Member
Thanks for the .pdf, but I'm still going to struggle to get my simulation going in VB6. The protocol just seems to be a method of connecting a 'software' PCB full of lamps and switches.

What I was really hoping for was a method of accessing the values stored in the variables, not just the state of the I/O pins. ( In the past, DDE was the easy way to do this, then MS moved onto OLE, nearly as easy, but with extra faffing. The method used in industry, OPC, made OLE as easy as DDE, once you fixed DCOM !. )

Or, and this may be more acceptable to RevEd, a method of 'sending' bytes to another app, even something as simple as re-directing 'serout' to a text file would be so much more useful than flashing a virtual LED.

Merry Christmas,

Buzby
 

Technical

Technical Support
Staff member
What I was really hoping for was a method of accessing the values stored in the variables, not just the state of the I/O pins. ( In the past, DDE was the easy way to do this, then MS moved onto OLE, nearly as easy, but with extra faffing. The method used in industry, OPC, made OLE as easy as DDE, once you fixed DCOM !. )
Why would you want to do that? The simulation is running within PE6, not the third party software. So corrupting the variables is just going to corrupt the simulation.

If you want to preload variables during simulation only to speed up things like for...next loops you can already do that e.g.

Code:
for b1 = 1 to 100

; if simulating jump straight to 99
#ifdef simulating
  if b1 < 99 then 
      b1 = 99
  end if
#endif

  pause 1000
next b1
 

Buzby

Senior Member
Hi Technical,

That's not quite what I was after.

I've got two projects where I would really like to 'see' what's going on inside, in a much better way than the tables of numbers in PE 5 or 6.

One of them is has a very large number of variables changing values in complex inter-related sequences. A VB app could easily display these in a more user friendly way. As it is I have to have lots of breakpoints, and copy the relevant sets of variables onto paper in an arrangement that makes it easy to understand.

Another is working with with phase angles and vectors. It would be so much easier to display these on a circular graph, again a doddle in VB, or even Excel.

I agree that sending data 'into' the simulation is not much use, but having a method to access the variables in a read-only manner would be *very* handy.

Cheers,

Buzby
 

hippy

Technical Support
Staff member
Or ... a method of 'sending' bytes to another app.
Untested but that is already implemented if you can put the byte to send onto output pins ...

dirsB = $FF
pinsB = "H"
pinsB = "e"
pinsB = "l"
pinsB = "l"
pinsB = "o"

Then just pick up the 'pinsb:xx' values sent down the pipe. To help with synchronisation, or to flag start of message, you can (probably) set dirsB=$00 then dirsB=$FF, or toggle a port C pin.

To pass out a pair of word values from 'w0' and 'w1', it could end up being something like ...

Toggle C.0
dirsB = $FF
pinsB = b0 ' w0 lsb
pinsB = b1 ' w0 msb
pinsB = b2 ' w1 lsb
pinsB = b3 ' w1 msb
 

Technical

Technical Support
Staff member
We're still not convinced, if you want to basically sertxd multiple variable values in to your own app why not simply do that from a real chip running the program instead of the PE6 simulation?
It will run much faster and does everything that you seem to require already.
 

Buzby

Senior Member
Disadvantages of a real chip :

1 - You need a real chip, PSU, board, I/O devices, desk space, and wires to join them all together.
2 - Can't set a breakpoint.
3 - Can't run slow when needed.
4 - Can't single-step.
5 - etc, etc, ...

The 'real chip' comes into play when the algorithms are fully tested, and the only thing left to check is hardware dependence. The two examples I gave, formatted data and circular graphs, are not how these devices will interface to the 'real world' in the finished article. Access to variables is just a tool for a clearer view of what's going on during development.

Every PLC development suite I use has some kind of facility to access and record what goes on inside the simulation, not just the real-time state of the simulated PLC I/O.

I don't think it would hurt RevEd to implement a simple interface to provide this facility on PICAXE.

@hippy,

Yes, you can light a fire by rubbing two sticks together, but it's so much easier if one of them is a match. :)



Cheers,

Buzby.
 

BESQUEUT

Senior Member
I've got two projects where I would really like to 'see' what's going on inside, in a much better way than the tables of numbers in PE 5 or 6.

One of them is has a very large number of variables changing values in complex inter-related sequences. A VB app could easily display these in a more user friendly way. As it is I have to have lots of breakpoints, and copy the relevant sets of variables onto paper in an arrangement that makes it easy to understand.

Another is working with with phase angles and vectors. It would be so much easier to display these on a circular graph, again a doddle in VB, or even Excel.

I agree that sending data 'into' the simulation is not much use, but having a method to access the variables in a read-only manner would be *very* handy.

Cheers,

Buzby
I agree 100 %
I have the same needs.

Plus : a pipe for I2C data flow... (VB6 as slave )
 

Buzby

Senior Member
I would really like to exchange a few bytes of data between a running PE6 Simulation and Excel. Even just the pin access in post #16 would do.

The basic instructions have been around for a few years, but I haven't got a clue where to start.

Has anyone managed to do this, and would they be willing to share their pipe. ( Ooh err missus ! )

Thanks,

Buzby
 
Top