UNO-SCADA

For general Flowcode discussion that does not belong in the other sections.
User avatar
p.erasmus
Posts: 434
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

UNO-SCADA

Post by p.erasmus »

Hi Team.

I need help to understand and work with the new SCADA API,

I have made a simple FC Chart using PIC16F1938 and transmit a SPI Transaction it woking as I would it should .

SPI_16F.jpg
SPI_16F.jpg (67.81 KiB) Viewed 6744 times

As you see here I have a decent Clock DATA and a CS line that is working ,the decoder can decode this and it decode the 2 bytes as 0xB7 and 0xBB
exactly as the code is written to output.

Using the exact same Chart with UNO scada the only signal/trace that is some how correct is the ( SCK) clock (yellow trace)
the MOSI(DATA)blue trace has no output and the CS(purple trace) is doing somewthing very strange far from a CS signal.
I am attching the FC chart if you can please show me what I am doing wrong in the new SCADA API I will be very happy as it has stopped to work with me .

SPI_UNO.jpg
SPI_UNO.jpg (76.38 KiB) Viewed 6744 times

Appreciate your help I am missing something in the new API the reason things are not working :D
Component_Scada.rar
(18.04 KiB) Downloaded 512 times
Regards Peter - QME Electronics

medelec35
Matrix Staff
Posts: 1913
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 621 times
Been thanked: 644 times

Re: UNO-SCADA

Post by medelec35 »

Hi, Peter
API works by sending commands via UART (with the exception of ESP32 and Raspberry Pi).
The UART RX commands tell the target device which peripheral to run.
There is firmware that will need to be loaded onto the target device in order to run all the commands.
In the case of the UNO you can find it here
If you download the Arduino Uno App Developer Firmware, the zip file contains the component source and the firmware source so you can see how it works.
Within that link, there are also some simple demos.
One of the demos is for SPI slave.
That should help you get going.
You can of course create your own API if you don't want you to use the supplied one, I did that with an ESP32 Mains power monitor
Martin

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: UNO-SCADA

Post by p.erasmus »

Thanks Martin.

What happend to the simple injector that we used to use for SCADA simulation?
No information as usual we must just know how to use new things it is getting anoying working with V9

There is a huge confusion lately we use to have injectors for SPI and I2C Hardware simulation now APP developer is somehow in the mix
(nobody isy commenting this to the users) and now you are telling me I must make my own API ,Why should I then use FC for fast simple HW simulation and coms development it worked well before !!
before I could use a injector run FC Sim and I could talk to my HW no all of a sudden it all UART based if I understand YOU CORRECTLY :oops: :oops: :oops:
5 weeks ago when I posted my I2C stopped working nobody mentioned this Ben only replied I must reflash with the new API Hex fiile :oops: :oops:
this seems to more that just the hex file that needs to be replace

I think the APP developer is only Fu*3K everything up, I am finish with this SCADA HW simulation as
Regards Peter - QME Electronics

BenR
Matrix Staff
Posts: 1926
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 686 times

Re: UNO-SCADA

Post by BenR »

Hello Peter,

The bouncing of the CS pin means the pin is probably floating and isn't being driven. The CS pin is assigned via the SPI component simulation properties. If the setting is not there then please can you post your program and I'll investigate for you.

Props.jpg
Props.jpg (10.4 KiB) Viewed 6718 times

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: UNO-SCADA

Post by p.erasmus »

Ben
with out being rude the file has been posted long time ago but this showsa me again how you guys look at my issues when I report something :oops: :oops: :oops:

Note also Ben that there is no MOSI output besides the CS pin issue !

I think you should move this topic to the VC section becuase there will be a few things said that not good for the forum :oops: :oops: :oops: :oops:
Regards Peter - QME Electronics

BenR
Matrix Staff
Posts: 1926
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 686 times

Re: UNO-SCADA

Post by BenR »

Sorry didn't spot the file link at the bottom.

I've just found a problem with SPI Master which has now been solved and here is an example using that.
SPI_API_Slave_Demo.fcfx
(9.6 KiB) Downloaded 443 times
I guess you are wanting the CS pin to be on the API Slave Pin 10, currently it is being assigned to pin 0 as your calling the CAL SPI component in your program.

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: UNO-SCADA

Post by p.erasmus »

Ben

Thanks setting the pin in simulation does solve the floating issue
but CS is NOT working and I have NO MOSI signal

I am confused now withe the UART mix Martin is talking about

P1.jpg
P1.jpg (19.78 KiB) Viewed 6711 times
DS1Z_QuickPrint1.png
DS1Z_QuickPrint1.png (44.48 KiB) Viewed 6711 times
Regards Peter - QME Electronics

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: UNO-SCADA

Post by p.erasmus »

Ben

I am sorry I am a bit frustrated battling now for some time with this
Thanks I will look :D
Regards Peter - QME Electronics

BenR
Matrix Staff
Posts: 1926
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 686 times

Re: UNO-SCADA

Post by BenR »

Ok sorry about this Peter,

I'll have another look today and do some testing and make sure we are all on the same page.

I'll get back to you ASAP with some news.

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: UNO-SCADA

Post by p.erasmus »

Hi Ben

Your example has no CS pin activity and no MOSI signal.
I do not know what is missing all I know the SPI and I2C with the old injectors worked perfect :D I knew which components to link to which ones to have a working system,but now I have no Idea what to use and what to expect :D

The HW simulation is one of the greatest things in Fc for me I appreciate all efforts Ben :D
DS1Z_QuickPrint1.png
DS1Z_QuickPrint1.png (43.51 KiB) Viewed 6707 times
Regards Peter - QME Electronics

Post Reply