CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Tue Sep 17, 2019 11:44 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Sep 07, 2014 12:42 pm 
Offline

Joined: Thu Jul 31, 2014 7:05 pm
Posts: 18
Hello all,

I'm learning about adding a trace element to the visualization and not sure if I'm seeing a bug or doing something wrong. I'm using a fresh install of 3.5 SP5 patch 1

Using the on-line help, I added a trace component on a background with two buttons in a visualization. The code for the buttons is as specified in the help file. Here is the simple ST program. The trace function task is 'Main Task' and the variable to trace is PLC_PRG.iHugo.

PROGRAM PLC_PRG
VAR
bStart: BOOL;
bStop: BOOL;
iHugo: INT;
END_VAR

iHugo := iHugo + 1;

When I enable the simulator and login, the program builds and the IDE shows 'Program Loaded'. There is a warning: C0315: String variable 'pszName too short... When I try to start the program, the IDE blinks 'Program Loaded - Exception'.

However, when I download this to my Raspberry PI, the program runs fine.

I had SP4 installed, but removed it and re-installed SP5. All the libraries loaded, etc. I have the newest Raspberry PI package installed, too. This is running under Windows 7 32 bit Virtual Machine in Virtual Box, with the latest Guest Additions.

BTW, the newly posted Trace vs Trend program does not run under the simulator for me either, neither does the WebVisu example project. I tried 'Updating the Device', just in case. They both run fine on the PI.

Does anybody know what I'm missing?
How can I debug the 'Program Load - Exception' issue?
How do I fix the C0315 error?

Thanks for your help.


Top
   
PostPosted: Mon Sep 08, 2014 8:48 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3450
Hi,

I agree that this should not lead to an exception in simulation modus,
there fore I'll add an entry in our bug tracking database.

But some kinds of application make from practical aspect more or less sense working with simulation.
-> Webvisu projects - Simulation does not contain a webserver
-> Trend in Simulation does not have the SQLite db
-> IO Handling -> Simulation does not have an IOManager

For these kind of applications I would always recommend to download the project to the local Control Win plc
which is available on every CODESYS installation.

If you go back to your real hardware plc - you only need to 'update the device' to your plc (Control Win -> Raspebrry Pi)

Debugging Exceptions in general:

Got to the plc log - rightclick on the exception should lead you to the code where the exception occure (if it is in the application or in the library)

BR
Edwin


Top
   
PostPosted: Tue Sep 09, 2014 2:37 am 
Offline

Joined: Thu Jul 31, 2014 7:05 pm
Posts: 18
Thanks for the help. I found the log. There are two back to back exceptions, which occur when I press the start button.

*SOURCEPOSITION* App=[Sim.Device.Application] area=0, offset=1206309
*EXCEPTION* [AccessViolation] occurred: App=[Sim.Device.Application], Task=[VISU_TASK]

I wonder if this is a permissions problem?


Top
   
PostPosted: Tue Sep 09, 2014 4:06 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3450
Hi,
what happens if you righclick on this line:
*SOURCEPOSITION* App=[Sim.Device.Application] area=0, offset=1206309
and try to go to the source position?
CODESYS should point you to the line of code where the exception occure (if it happens in the IECCode) or should point you to the library if it is a compiled library.

BR
Edwin


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited