Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Array of digitals in PLC

Array of digitals in PLC 3 years 4 months ago #10864

  • Bruce@Spang
  • Bruce@Spang's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 41
  • Karma: 0
See attached image - using an array of digital values (set by table selection), a simple OR operation doesn't work.
Am I accessing the array values in PLC correctly (GetDp?). I tried several other GetDxx variants but nothing seems to work correctly.

The image is a Trace, the first element of the array is true yet the OR object has a status of false.
Attachments:
The administrator has disabled public write access.

Array of digitals in PLC 3 years 4 months ago #10866

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi Bruce,

If selSp.Value is a boolean array, the code is correct. You have probably missed something in the build/distribute sequence. Did you build the correct node?

/Claes
The administrator has disabled public write access.

Array of digitals in PLC 3 years 4 months ago #10868

  • Bruce@Spang
  • Bruce@Spang's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 41
  • Karma: 0
Ah, the problem is that no PLC code is updating... this is the first PLC update since I installed the Pwrp 5.7.1-1 Development package. Even simple logic fails to actually work, with no apparent errors.

I see node build errors that I did not have in 5.7:
-- Build node raspberrypi
Ctx:open syntax error
Ctx:open syntax error
Ctx:open syntax error
Ctx:open syntax error
Ctx:open syntax error
Ctx:open syntax error
Ctx:open syntax error
Ctx:open syntax error
Ctx:open syntax error
Ctx:open syntax error
Ctx:open syntax error
Ctx:open syntax error

And I see that Ge and the Volume configurator now show a wrench symbol for 'build', but the PLC program does not and still shows the 'paper airplane' icon (see attached photo). I am suspicious that 5.7.1 version may not be correctly installed?
Attachments:
The administrator has disabled public write access.

Array of digitals in PLC 3 years 4 months ago #10869

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
We had to change some icons because standard GTK icons didn't work so well in the QT version, but I actually forgot to change the build icon in the plc editor. 'Ctx:open syntax error' is from the Ge graphs probably when searching for cross references. They make no harm and will probably disappear if you open and save the graphs. So I don't think there is anything wrong with the installation.

Instead I think you should check the build sequence and that the correct files are created.

1. When you compile a PlcPgm two .o files should be created in $pwrp_obj. Check the dates on these files (use 'ls -ltr' to see the latest files).
2. When you build the node those files are linked with the plc executable, that you can see on $pwrp_exe (ls -l $pwrp_exe/plc*'). There might be several plc executables for simulation nodes etc, so check with 'ps x' which one is running.
3. When you build the node, also a .dbs file on $pwrp_load is created containing the objects in the database. Also check the date of this file.
4. In the object graph for the $Node object on the last row you can see the Boot version, and this is the version that is actually running. It should be that same as the date of the .dbs-file and the plc executable at the time the latest restart.

/Claes
The administrator has disabled public write access.

Array of digitals in PLC 3 years 4 months ago #10870

  • Bruce@Spang
  • Bruce@Spang's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 41
  • Karma: 0
Thank you so much for your support!!

So I see that the issue seems to be that the $pwrp_obj and other project symbols are not properly being set up when the project opens which seems to come from:

pwrp@raspberrypi//-./> pwrp set project 1051communications
Setting base /usr/pwr57
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Welcome to
1051communications V5.7 Large Display using Modbus TCP

Revision history
2020-04-10 pwrp Project created
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
pwrp@raspberrypi/1051communications/-.login> sdf
Setting base /usr/pwr57
bash: [: 1051communications: unary operator expected
No such project ''
pwrp@raspberrypi/1051communications/-.login>

I am digging around trying to find the root cause of this problem now..
The administrator has disabled public write access.

Array of digitals in PLC 3 years 4 months ago #10876

  • Bruce@Spang
  • Bruce@Spang's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 41
  • Karma: 0
Found it. A change I made to pwra_env.sh broke things... Fixed...
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 9.107 seconds