I/O Mapping with the new PLC IDE

I got a chance to try out the new PLC IDE with the Portenta Machine Control over the past two days. There may be more documentation coming, but I am running into challenges with loading a first 'simple trial' Ladder program.

Essentially, the problem is that I can download a simple program with just one NO contact and one momentary coil. It seems to download without problems, but will not execute.

I have a selector switch connected to Digital Input 00. When I turn the switch, the green LED energizes, so it appears that the hardware side is working.

I have created a variable SS1, and mapped it to %IX0.0.
Did the same with a variable Out1, mapped this to %Q0.0.

My assumption is that these correlate respectively to the first bit of the first byte for both input and output registers, much like Siemens TIA portal. (I cannot find a reference for variable addresses in the documentation, like exactly what addresses correlate to the I, O, and the programmable sets of terminals).

The Machine Control appears to be connected and online, and the LD is downloaded, but the output 00 never energizes.

When the variables are added to the watch table, they are both FALSE regardless of the LED status on the input itself.

Also of note: the standard built-in program that increments the cnt variable, that seems to run successfully and updates in the watch table.

My thought is that I do not quite understand the mapping process, since it does not execute, AND does not update on the watch table. If the watch table was updating, I might assume the problem is in project organization and the rung is simple not executing.

If I can provide helpful screenshots, I can do so - this is a little different than embedding code from the normal IDE so I'm not sure what all to include.

PS THANKS ARDUINO for this PLC IDE. I'm super excited to play with this software!!

1 Like

After a bit more experimentation, it seems I may have an issue with the input wiring which I cannot put my finger on.

The I/O variables are mapped as stated before (%IX0.0 is called SS1, and %Q0.0 is called Out1).

When I use a ST 'main' program, I write the following line of code:
Out1 := 1;

And sure enough, when I download, the red LED on DO 00 turns on.

Then, I change it to:
Out1 := SS1;

Both of these are BOOLs, so it should reflect the selector switch (SS1) state to the output Out1.

Now the output LED does not turn on.

The green LED on In 00 appears to work when the switch is changed. However, neither the watch table nor the downloaded program seem to recognize when this input is 'on'.

Another note: when I edit the LD and change the NO contact to an NC contact, the output energizes, telling me that the LD is indeed being executed correct, except, once again, the input signal does not ever seem to be updated.

I attached an image of my wiring setup, not elegant but I was just going for testing right now.

The GND connection has been made back to the power supply, and the green light at Input 00 lights up when the switch is energized.

+24 v P/S --> Selector Switch --> In 00 --> -24 v P/S

1 Like

I am starting to think there may be bugs in the new PLC IDE. I am having a similar issue where I can't read RTD inputs (when I enable it just reads high threshold fault). The rtd's are wired correctly because they read correctly when I make a sketch to read them in the standard Arduino IDE. Hopefully there will be more documentation and/or fixes soon.

I'm taking a trip down the rabbit hole of the ArduinoPMC target files and spotted its IO definitions. Hope they help anyone interested. I'll also be plugging away at the IO I can with my own unit to shed more light.

sysDigitalInputs AT %IX0.0	: ARRAY[ 0..7 ] OF BOOL; { IO:"System digital inputs" }
sysDigitalOutputs AT %QX0.0 : ARRAY[ 0..7 ] OF BOOL; { IO:"System digital outputs" }
sysAnalogInputs AT %ID1.0 : ARRAY[ 0..2 ] OF DINT; { IO:"System analog inputs" }
sysAnalogOutputs AT %QD1.0 : ARRAY[ 0..3 ] OF REAL; { IO:"System analog outputs" }
sysTempProbes AT %ID2.0	: ARRAY[ 0..2 ] OF sysTempProbesType; { IO:"System temperature probes" }
sysDigitalProgrammables AT %MX3.0 : ARRAY[ 0..11 ] OF BOOL; { IO:"System  digital programmables I/O" }
sysEncodersInputs AT %IB5.0	: ARRAY[ 0..1 ]	 OF sysEncoderInputType;	{ IO:"System encoders status" }
TYPE
	sysEncoderInputType : STRUCT { DE:"PLC econder status" }
		currentState : INT;
		pulsesCount : INT;
		revolutionsCount : INT;
	END_STRUCT;
	
	sysTempProbesType : STRUCT { DE:"PLC temperature probe status" }
		enabled : BOOL;
		highThresholdFault : BOOL;
		lowThresholdFault : BOOL;
		lowREFINFault : BOOL;
		highREFINFFault : BOOL;
		lowRTDINFault : BOOL;
		voltageFault : BOOL;
		faultMask : BYTE;
		rRef : REAL;
		rNominal : REAL;
		ratio: REAL;
		resistance: REAL;
		rtd : UINT;
		temperature : UINT;		
	END_STRUCT;
END_TYPE
1 Like

Tested the digital inputs on my PMC:

  • %IX0.0: Board indicator works, BOOL does not reflect.
  • %IX0.1: Board indicator works, BOOL reflects.
  • %IX0.2: Board indicator works, BOOL reflects.
  • %IX0.3: Board indicator works, BOOL reflects.
  • %IX0.4: Board indicator works, BOOL reflects.
  • %IX0.5: Board indicator works, BOOL reflects.
  • %IX0.6: Board indicator works, BOOL reflects.
  • %IX0.7: Board indicator works, BOOL reflects.
1 Like

Programmable Digital IO (configured as inputs):

  • %MX3.0: No board indication, BOOL reflects.
  • %MX3.1: No board indication, BOOL reflects.
  • %MX3.2: No board indication, BOOL reflects.
  • %MX3.3: No board indication, BOOL reflects.
  • %MX3.4: No board indication, BOOL reflects.
  • %MX3.5: No board indication, BOOL reflects.
  • %MX3.6: No board indication, BOOL reflects.
  • %MX3.7: No board indication, BOOL reflects.
  • %MX3.8: No board indication, BOOL reflects.
  • %MX3.9: No board indication, BOOL reflects.
  • %MX3.10: No board indication, BOOL reflects.
  • %MX3.11: No board indication, BOOL reflects.
1 Like

Programmable Digital IO (configured as outputs):

  • %MX3.0: Board indicator works, BOOL reflects.
  • %MX3.1: Board indicator works, BOOL reflects.
  • %MX3.2: Board indicator works, BOOL reflects.
  • %MX3.3: Board indicator works, BOOL reflects.
  • %MX3.4: Board indicator works, BOOL reflects.
  • %MX3.5: Board indicator works, BOOL reflects.
  • %MX3.6: Board indicator works, BOOL reflects.
  • %MX3.7: Board indicator works, BOOL reflects.
  • %MX3.8: Board indicator works, BOOL reflects.
  • %MX3.9: Board indicator works, BOOL reflects.
  • %MX3.10: Board indicator works, BOOL reflects.
  • %MX3.11: Board indicator works, BOOL reflects.

No +24V on any point. Is this a sinking output bank?

1 Like

Thanks @jeremym1987, very thorough analysis.

I should be able to test my own configuration in a bit and see if my results are similar to yours, including the configurable ones. Could be that I just chose the first one unluckily and didn't go to the next step of testing a second input terminal.

Obvious question, but when you were testing for voltage on the programmable output pins, were the +24 and 0v both connected to an external power supply?

Yes. Both wired to power supply.

I have some relays handy so that I can at some point test for whether these are indeed sinking outputs. I suppose a continuity test between the point when "energized" and DC common ought to answer this, as well.

1 Like

Verified - moved the selector switch to input 1 (%IX0.1).

Works like a charm, and a simple ladder rung now responds exactly as expected. I have not tested all others, but this reflects the initial I/O results reported previously.

Wondering how consistent this problem is for other users, specifically the IX0.0 failing to update in the IDE?

You could consider us a sample size 2: %IX0.0 does not reflect the state of the input in the runtime.

In good news, now with working inputs connected, all function blocks in IEC 61131 languages (arithmetic, timers, counters so far) are working great in test setups, and very easy to use!

1 Like

Yes.

With memory allocations (almost) fixed, I can also carve out a good deal of what I'm implementing.

Will work on analog IO testing as I go.

@jeremym1987 and anyone else following, the programmable outputs are sourcing.

I configured programmable terminal 03 (%MX3.3) as an output, then allowed a ladder rung to energize it.
A 24 vDC ice cube relay was connected to that programmable terminal, and it energized successfully. 24 volts from the terminal, to the relay coil, then to ground.

I realize the original problem in the post was addressed, but if anyone sees the question on the thread, it is answered here.

Good to know, I'll try them individually in a bit. My original test had them all energized at once.

PLC IDE Tools 0.29 is out.

Hi, i need some help, how can i do the simulation of a ladder program in PLC IDE?