Arduino PLC IDE Released

This "Fast" cycle seams to slow. Is it possible to make it faster, or even better not with fixed time?

arduino_fast_cycle.png
 
In LogicLab you can modify the value. Not sure why it’s fixed in the Arduino IDE. You might try opening the project file in a text editor to see if it can be changed.

edit:
yes you can. before and after pics attached. it doesn't accept 0 us without reverting to 10 ms.

it can go as low as 0.001 ms. not quite "continuous" but probably close enough.

Screenshot 2022-12-09 232119.png Screenshot 2022-12-09 232219.png Screenshot 2022-12-09 232610.png
 
Last edited:
@JeremyM, thank you for info. I presume that there are reasons why they did not allow shorter cycles.
 
Hardware arrived today and I got it set up, activated, and running. Learning the connection process was a bit of trial and error, so they could improve documentation there.

Cliffs:
- device allocates 2 COM ports over USB.
- initial setup and/or hardware config push is on lowest COM port allocated for the device.
- set up PLC IDE comms for Modbus RTU, ID 247, 38400 N-8-1, on highest COM port allocated.
- IP address is set up by uncommenting the small arduino sketch code bundled in a new project. became pingable right away.
- couldn’t get downloads to work over Ethernet - an “upload port” wasn’t available.
- haven’t attempted WiFi yet.

Online code updates aren’t a thing yet as far as I can tell - modifications seem to require a quick restart of the device.
 
Last edited:
Is this a cold boot or a warm/soft boot?

The IDE reports it being a warm restart. It is very quick and non-retentive values are initialized.

A cold restart occurs when downloading after an offline project rebuild. This makes sense.
 
Last edited:
The amount of memory reported being available doesn't match the hardware by a long shot. I've barely begun to scratch the surface of framework code I'm writing, so I'm hoping this is just an early bug.

I'll look around in the target definition files for something more concrete.

Screenshot 2022-12-13 165829.png
 
@JeremyM Could you try to make some application that is CPU time requiring and make the CPU scan less than 1ms?
I would like to know will that make problems. This is something that will guide me in what purposes I can use the Arduino PLC, and will it be usable for fast applications.
 
At less than 1ms, couldn't communicate online with the target. It was running application code but probably interrupting the comms stack to the point of timeout since everything seems to run on one core.

At 2ms, online communications seem stable.

At 10ms, upload/download is far faster, probably confirming what I think is going on at less than 1ms.

Theory: Current Arduino runtime might be similar to the Logix comms time slice model for the 5x70 and earlier hardware.
 
Last edited:
I was afraid about that. For me it means that, it is good for control of slower processes, and unfortunately not good for motion control and most communication applications. But still there are a lot of usable purposes. Well it is 1.0 version, I presume it will be better over time.
 
I’m not sure such applications are conclusively ruled out.

- Modbus (RTU or TCP) isn’t exactly geared towards determinism.
- Comms above were between my IDE and the controller.
- Comms above are using Modbus by serial with a configured 1-second timeout at 38400.
- The application code was indeed running, so deterministic, hard-wired I/O with a task period of 0.001ms is likely doable. I didn’t yet test this, but I can later. A simple conceptual “XIC DI0 OTE DO0” ought to prove out whether the app is carrying out its duty.
- Indeed this is a v1.0 effort, so the future may open up the extra M4 core being used for asynchronous comms alone while the M7 handles the application proper. IMO this is the way to go.
- The M4 is a 32-bit core at sufficient enough speed to handle several protocol stacks at once.
 
Last edited:
The amount of memory reported being available doesn't match the hardware by a long shot. I've barely begun to scratch the surface of framework code I'm writing, so I'm hoping this is just an early bug.

I'll look around in the target definition files for something more concrete.

I was able to modify the projectName.imgx file's description for this region of memory and adjust the code memory available to 32KB. This file is found in the same location as the projectName.plcprj file and appears to be an xml definition for a flat 32-bit memory layout that includes the embedded IEC functions' addresses, so care must be taken to avoid overlapping into another region. I am also unsure what the attribute addrArea2 means in this context.

Original values (8KB):
Code:
<codeArea address="0x38000400" size="0x2000" addrArea1="0x38002400" addrArea2="0x38000400"/>

New values (32KB):
Code:
<codeArea address="0x38000400" size="0x8000" addrArea1="0x38008400" addrArea2="0x38000400"/>

Compiler diagnostic output:
Code:
Used code size:	         15BCh (    5 KByte)
Free code space:	 6A44h (   26 KByte)
Total code space:	 8000h (   32 KByte)

Used data space:	   C4h (    0 KByte)
Free data space:	 3F3Ch (   15 KByte)
Total data space:        4000h (   16 KByte)

Used retain data space:	    0h (    0 KByte)
Free retain data space:   400h (    1 KByte)
Total retain data space:  400h (    1 KByte)
 
Last edited:
At less than 1ms, couldn't communicate online with the target. It was running application code but probably interrupting the comms stack to the point of timeout since everything seems to run on one core.

At 2ms, online communications seem stable.

At 10ms, upload/download is far faster, probably confirming what I think is going on at less than 1ms.

Theory: Current Arduino runtime might be similar to the Logix comms time slice model for the 5x70 and earlier hardware.

When you are online with the 'PLC' do you see the state of the logic in the editor or are you looking at tags in the watch window only?

For me .. I'm *OLD* .. a lot of the utility of PLCs is seeing what state the logic is in while it is operating ;)

I didn't see any mention of online edits (but it's getting toward the end of Friday and I *MAY* not be paying as much attention as I should be) ... can you do online edits or is it offline changes and download?

There are many communications places that I think this system would be handy. If it's easy enough to configure, I'd only need to keep one version of hardware/software working for the next decade
 

Similar Topics

I'm trying to write a data in Arduino using MODWR function block .I used the code I got from online for both PLC and Arduino. I made the wiring...
Replies
4
Views
97
I am working on a project that had originally started on a sparkfun redboard artemis. Through some testing I've pushed to utilize a PLC for the...
Replies
9
Views
1,589
Hello, I have been getting more and more requests for Real Time Clock (RTC) sensitive automation from my clients. I know that there is a Modbus...
Replies
13
Views
2,733
https://www.hackster.io/news/arduino-unveils-the-opta-its-first-micro-plc-for-the-industrial-internet-of-things-d97f1d6b868a...
Replies
32
Views
10,135
hi Friends , please i have plc FX2N and i have Arduino mega, i have too ttl-rs232, i have cable rs232, i want conecte Arduino to plc , if i active...
Replies
4
Views
2,048
Back
Top Bottom