Using the Scope with ghost

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Using the Scope with ghost

Post by QMESAR »

Hi All

I apologize for asking so many questions I really appreciate your help and patience with me.

I what to use the Gost on my EB006V9 to send me the state of a pin and the value of an a voltage on the AN0 pin to the scope component and if possible the bit value of the conversion to a gauge
my uncertainty is for the scope do i also need to add the simulation components as explained in the wiki for the scope ??

I appreciate your help ;If you guys can just tell me the correct step then i will read help file and try to get the job done
Attachments
1.jpg
1.jpg (53.44 KiB) Viewed 7572 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using the Scope with ghost

Post by Benj »

Hello Peter,

In the Debug -> Ghost -> Options -> ICT Options.

Enable the ICT monitoring, set the sample rate and tick the tick box next to Analogue monitoring for PortA pin 0.

Click OK.

Next from the Components -> Tools select the Scope monitor component and drag onto your panel.

Select the monitor component on the panel and in the properties pane set the analogue trace to AN0 and the digital trace to the digital pin you want to monitor. This should set up all the scope group and streams for you.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Using the Scope with ghost

Post by QMESAR »

Hello Benj
Thank you very much this did the job.

just another question if I have a variable in which I calculate Rpm from the input pulse signal at a pin ,can I get the value over ghost and display it in a meter
what I mean is the pulse trigger on pin RB0 is transformed into a Rpm of the machine i would like in ICT to display this calculated Rpm in a meter on the dash board
Attachments
Meter to show calculated Rpm from input pulse
Meter to show calculated Rpm from input pulse
4.jpg (21.7 KiB) Viewed 7542 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Using the Scope with ghost

Post by Benj »

Hello,

With test mode active the simulation is no longer active, e.g. the panels no longer simulate. We are working on improving this functionality in future to basically allow what you are suggesting but there are complications.

It would be possible to use say a RS232 or USB Serial connection to allow you to pass data to the Flowcode simulation like I do for this blog article. http://matrixtsl.com/blog/?p=82

This way the panels are still active and you can do pretty much anything you want with the data in the simulation.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Using the Scope with ghost

Post by QMESAR »

Benj wrote: With test mode active the simulation is no longer active, e.g. the panels no longer simulate. We are working on improving this functionality in future to basically allow what you are suggesting but there are complications.
That would be a great feature for FC ,I really hope that you guys will get this done sometime in future I have been looking for years to have a tool in which I can write code simulate and run in real time with data monitoring in the same tool
It would be possible to use say a RS232 or USB Serial connection to allow you to pass data to the Flowcode simulation like I do for this blog article. http://matrixtsl.com/blog/?p=82
This way the panels are still active and you can do pretty much anything you want with the data in the simulation
This is a great and will work for me :D Hope you get the other method to work over Ghost

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Using the Scope with ghost

Post by QMESAR »

Hi Benj
linking my application to the Serial and the Simulation panels worked well :D
however I am not sure I handle the receiving correctly and any help regarding this will be appreciated

What I did is the following (because I am not sure where FC saves the received byte the help file also does not mention this)
I check for a the firsts byte to be received and then in a loop read the amount of bytes that I send from the mcu ,this loop places each byte
in consecutively is my ReceiveDataBuffer(Array of 9 bytes) for where I can manipulate the data and display it on indicators in the Dashboard

is there a better way to read the data bytes from the rs 232 receive macro (where does FC place the received bytes ) ?
Attachments
SerialRx.jpg
(99.13 KiB) Downloaded 2165 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Using the Scope with ghost

Post by medelec35 »

Hi QMESAR,
As you probably are aware,RS232 can only received a byte at a time.
So if it was me and I was waiting for RPM data then for receiving I would set up RS232 as an RS232 RX interrupt.
I would think the best way to TX and RX would be with string values (since no data = 255) then after string been sent have a time out function.
This could comprise of a timer interrupt that times out after no data received for say 500ms.
The string values can be converted to integer via string to in function.

I can help you with flowcharts if you get stuck.
Martin

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Using the Scope with ghost

Post by QMESAR »

medelec35 wrote: So if it was me and I was waiting for RPM data then for receiving I would set up RS232 as an RS232 RX interrupt.
Hi Martin
Thank you for your reply :D
I use the Rx Interrupt method in some applications with Serial USB however this is the first time I use FC to display some machine data (normally I use VB.net) this is so useful when I can program and read the data back into the same sofwtare
for example ,I change PID parameters and in software download to the mcu run the machine do a step response and plot the data into FC Scope no switching between software's.

Does this Interrupt Rs232 Rx function when running in FC simulation execute correctly as it would in the mcu ? secondly I am still confused where does FC place the Rx data after reception' :oops:
Last edited by QMESAR on Sun Nov 23, 2014 9:41 pm, edited 2 times in total.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Using the Scope with ghost

Post by medelec35 »

QMESAR wrote:Does this Interrupt Rs232 Rx function when running in FC simulation execute correctly as it would in the mcu ?
Ah, I just remembered I had requested the rs232 to work with simulation so I don't think what I suggested will work with simulation.

Could you post a flowchart so I can look at the RS232 TX side.
I may have an alternative solution.
Martin

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: Using the Scope with ghost

Post by QMESAR »

Hi Martin

This is just a very crude project I made to get to know how to work with the RS232 to get the data from the mcu into FC and how to display it on the FC indicators
no attention is payed to good code and programming practices it is purely to try FC and the displays for implementation in future projects

Thanks a million for your help
Attachments
33EP_ADC.zip
(102.94 KiB) Downloaded 228 times

Post Reply