I'd like to create a component where if a Scada slave is added by the user it can be used in Scada mode.
I can do this 'as source' where the SCADA slave can be added to the injector component - and this works well in simulation.
But I'd like to 'expose' this to the top level, so that I can export as a component and give the user the option to add the SCADA slave of their choice (rather than including the Arduino SCADA or whatever..)
This I (try to) do by clicking 'expose to top level' - however the variable has no options and 'clicking' on it resets the underlying value to null.
I assume I need to populate the list of components offered to the user - but not sure which events are needed to do this?
Any pointers much appreciated.
Martin
SCADA Component object Slave
-
- Valued Contributor
- Posts: 1453
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 135 times
- Been thanked: 707 times
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: SCADA Component object Slave
Hi Martin.
good question ? I wish I could help you
I have ask similar questions here
seems the team are very busy at the moment ,
viewtopic.php?f=3&t=284
good question ? I wish I could help you
I have ask similar questions here

viewtopic.php?f=3&t=284

Regards Peter - QME Electronics
-
- Valued Contributor
- Posts: 1453
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 135 times
- Been thanked: 707 times
Re: SCADA Component object Slave
Hmm, it's tricky..
I think I've managed to 'pull' the components using:
Which when stepped through sets main.str to each component's name. Next - can I attach this to the drop down menu ???
Software timer is just there as a test component (also had a couple more added to the project...)
Martin
I think I've managed to 'pull' the components using:
Which when stepped through sets main.str to each component's name. Next - can I attach this to the drop down menu ???
Software timer is just there as a test component (also had a couple more added to the project...)
Martin
-
- Valued Contributor
- Posts: 1453
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 135 times
- Been thanked: 707 times
Re: SCADA Component object Slave
I guess I should probably use a EV_ADDED event handler to add the component name to the list each time one is added.
No joy with this route yet though
Martin
No joy with this route yet though

Martin
-
- Matrix Staff
- Posts: 1465
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 204 times
- Been thanked: 347 times
Re: SCADA Component object Slave
Sorry, Peter. It looks like this one was forgotten about. And yes - always busy! But also there are a few people off work due to the Easter holidays.p.erasmus wrote: ↑Tue Apr 06, 2021 7:08 pmI have ask similar questions hereseems the team are very busy at the moment ,
viewtopic.php?f=3&t=284![]()
I'll ask around to see if anyone can help with this and Martin's questions.
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: SCADA Component object Slave
Hello,
I'm not sure if this is currently possible. I tried to do something similar for the network comms component and found the same problems. Which is why we have the visible network comms layer in our programs.
The Injector to SCADA Slave property uses the Panel Object property type and this only seems to go one level up from the component source.
This works
Panel
-Injector
-Scada Slave
This doesn't work
Panel
-Component
--Injector
-Scada Slave
We can maybe look into this or change the way that injectors point to their host component to allow for this mapping. The way the comms components hooks to an injector component is a bit more intelligent and this method might work.
I'm not sure if this is currently possible. I tried to do something similar for the network comms component and found the same problems. Which is why we have the visible network comms layer in our programs.
The Injector to SCADA Slave property uses the Panel Object property type and this only seems to go one level up from the component source.
This works
Panel
-Injector
-Scada Slave
This doesn't work
Panel
-Component
--Injector
-Scada Slave
We can maybe look into this or change the way that injectors point to their host component to allow for this mapping. The way the comms components hooks to an injector component is a bit more intelligent and this method might work.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 1453
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 135 times
- Been thanked: 707 times
Re: SCADA Component object Slave
Thanks Ben,
As a supplementary question - how do I add simulation/SCADA only code.
In v8 I'd use the [SIM] block - but this seems to have disappeared in v9. Or maybe I'm just not spotting it?
Martin
As a supplementary question - how do I add simulation/SCADA only code.
In v8 I'd use the [SIM] block - but this seems to have disappeared in v9. Or maybe I'm just not spotting it?
Martin
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: SCADA Component object Slave
Hi Martin
my be I am off the point however
I use one of the provided Comms Templates,which has property for simulation COMMS Yes or NO
in the Yes case we place all the calls to the HW macro's.this then runs on the Scada if NO is selected you down to normal Panel Simulation
so SACADA code and Panal simulation are in the SIM Macro and the Downloadable code in the HW macro example myMacro has all the embedded code and myMacroSim has the switch for SCADA or Panel simulation and the SCADA calls the myMacro which is the HW embedded macro
take a look at the templates
my be I am off the point however
I use one of the provided Comms Templates,which has property for simulation COMMS Yes or NO
in the Yes case we place all the calls to the HW macro's.this then runs on the Scada if NO is selected you down to normal Panel Simulation
so SACADA code and Panal simulation are in the SIM Macro and the Downloadable code in the HW macro example myMacro has all the embedded code and myMacroSim has the switch for SCADA or Panel simulation and the SCADA calls the myMacro which is the HW embedded macro
take a look at the templates
Regards Peter - QME Electronics
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: SCADA Component object Slave
Martin,
Not necessarily The Switch for COMMS Simulation is part of the panel properties in the template,so when you export the component these panel properties are part of the Component properties and
for each HW embedded macro you have you create a Sim macro with the Swich statement to detect if COMMS Sim is YES OR NO if yes it execute the one part of the if statement which you do a call to the HW macro and the NO side you do a panel simulation if you want.
so if you have a CAL component as part of the Componet then when the component is exported and the user load it for a PIC FC will load the CAL componet for PIC if another user load a STM the Flowcode will load the CAL for STM
So for example you have embedded macro Sendbyte() which send a byte over the SPI CAL then you make a SendByteSim() in the YES part of the Switch or if statement you call the macro Sendbyte so now when you simulate and COMMS is set to yes then the Sendbyte HW macro is called and put threw the injector to SCADA if NO then it will not call it but you can then do some simulation on the panel
in the interface tab of the Export component properties you set Sendbyte as Downloadable and its simulation macro as Hidden macro
so when your user program his chip the Sendbyte () macro is in embedded code if he runs simulation with COMMS set to YES then FC call the SendByteSim macro and execute the HW SendByte macro but threw the SCADA injector , This is all mcu independent . the suer selcet the mcu he uses and FC will call the correct CAL file for the mcu he is using,
Hope I could explain it somehow
Not necessarily The Switch for COMMS Simulation is part of the panel properties in the template,so when you export the component these panel properties are part of the Component properties and
for each HW embedded macro you have you create a Sim macro with the Swich statement to detect if COMMS Sim is YES OR NO if yes it execute the one part of the if statement which you do a call to the HW macro and the NO side you do a panel simulation if you want.
so if you have a CAL component as part of the Componet then when the component is exported and the user load it for a PIC FC will load the CAL componet for PIC if another user load a STM the Flowcode will load the CAL for STM
So for example you have embedded macro Sendbyte() which send a byte over the SPI CAL then you make a SendByteSim() in the YES part of the Switch or if statement you call the macro Sendbyte so now when you simulate and COMMS is set to yes then the Sendbyte HW macro is called and put threw the injector to SCADA if NO then it will not call it but you can then do some simulation on the panel
in the interface tab of the Export component properties you set Sendbyte as Downloadable and its simulation macro as Hidden macro
so when your user program his chip the Sendbyte () macro is in embedded code if he runs simulation with COMMS set to YES then FC call the SendByteSim macro and execute the HW SendByte macro but threw the SCADA injector , This is all mcu independent . the suer selcet the mcu he uses and FC will call the correct CAL file for the mcu he is using,
Hope I could explain it somehow
Regards Peter - QME Electronics