Page 1 of 1

Scada Injector for I2C changed to API _I2C

Posted: Mon May 17, 2021 12:01 pm
by p.erasmus
:idea:

Re: Scada Injector for I2C changed too API _I2C

Posted: Fri May 21, 2021 12:38 pm
by BenR
Hello Peter,

We've been having a rethink with the API and Injector components and think we have managed to simplify things by removing the injector layer.

Now the CAL I2C can connect directly to the API target and can correctly list API targets with I2C peripherals allowing for easier connections and more importantly API targets with more then one peripheral channel. We have also removed a number of bugs as well as making things faster by allowing SPI and I2C transactions to be used.

So for example the ESP API target has now been upgraded with 2x I2C, 2x SPI and 2x UART peripherals. With the I2C transactions in place a command such as a GLCD clear that used to take hundreds of API calls can now be done in a single call.

I am aware that this has been quite a disruptive process however we want to build a lot more on top of this and so we wanted to get the framework right from the ground up.

We still have some holes that have been created such as Vnet and other none API injectors are currently not supported. We don't think these are very popular atm largely due to complexity, however If anyone is using these then they can roll back the components to an earlier version or they can let us know and we can make it a priority to recreate these using the new paradigm.

There are also some holes in terms of missing properties for the SPI CS pin and the UART RS485 DDR Pin that have been added to the SPI / UART CAL and need exposing in the host component. We have done this work but we have not re-exported all the components yet. If there are any components that anyone needs this to be done to then we can do this as a priority.

Re: Scada Injector for I2C changed too API _I2C

Posted: Fri May 21, 2021 1:07 pm
by p.erasmus
Hello Ben,

Thanks for the explanation appreciated,

How do I get my SCADA working with I2C now
(1) I have now on the panel a API_I2C
(2) Scada component for UNO
(3) I had my I2C working with transaction mode on the old injector

since the component(Injector ) changed after I updated all stopped to work only the lamps TX and RX on the Scada(UNO) API component
flash but there is no output of I2C signals on the UNO HW (I monitor this always in parallel with my Logic analyser)

what must I do ? is there may be a new SCADA API hex file for the Uno ? I have no idea what is missing at the moment this project was working 100% with the old injector and the new UNO API (Scada) so it must be injector new API_I2C related .

:D

Re: Scada Injector for I2C changed to API _I2C

Posted: Tue May 25, 2021 9:16 am
by BenR
Hi Peter,

Previously transaction calls in the simulation runtime were split up into the individual API calls, start, tx, stop etc.

Now transaction calls are done properly via a new transaction API call which requires new firmware. The latest firmware is available via the component wiki page.

Please let me know if you have any problems and I'll do my best to jump on them for you.

Re: Scada Injector for I2C changed to API _I2C

Posted: Thu May 27, 2021 7:46 am
by p.erasmus
Hi Ben.

I have flashed my UNO with the SCADA_API hex file and unfortunately it not working ,just to let you know I exported the component and ran the code (component) on UNO,PIC16 and ESP32 working just as it worked in development with the old injector with SACAD UNO

There is an issue however I left it now as I lost to many time on this already . I will soon start a new Component and then I will see and report

just one question did you guys test the new I2C_API with an UNO ,I don't think so :D :D

Have good one
Peter

Re: Scada Injector for I2C changed to API _I2C

Posted: Sat May 29, 2021 6:46 pm
by mnfisher
Hi Ben,

Just been trying to get a ssd1306(i2c) display working in SCADA mode (Okay I'm expecting slow - but it did work previously).

A simple test program :
i2c test.fcfx
(11.25 KiB) Downloaded 472 times
Works okay on the MCU (printing 'Hello')

However - it doesn't seem to work in SCADA mode. Indeed it's worse in that FC crashes after several minutes (Fatal exception)

One thing I notice in the Arduino Firmware is that it allows for a block off up to 0x7fff bytes to be written in transaction mode (- but the buffer used is only 256 bytes) - this isn't the problem - as the LCD component splits clears etc into 'byte' writes.
we have managed to simplify things by removing the injector layer.
- should the 'injector' in the LCD component be replaced by something else?

Martin

Re: Scada Injector for I2C changed to API _I2C

Posted: Tue Jun 01, 2021 10:14 pm
by BenR
Hi Martin,

Thanks for letting us know. Investigating now.

I've now fixed the crash but there is still something a bit off so seeing if I can fully bottom it before I report back.

Re: Scada Injector for I2C changed to API _I2C

Posted: Wed Jun 02, 2021 10:16 am
by mnfisher
Thanks Ben,

I notice another problem in the Uno SCADA firmware - on getting a pin state (cmd 0x81) - ReturnCount should be set to 1 (to return the data). The ArduinoMega firmware does this correctly (and I didn't check the others....)

Martin