Problem:

There may be a problem when using the Codesys Key/Dongle and the starting of the plc.

The Codesys Key/Dongle seems to be recognized a few seconds after the PLC is started, depending on the system.

As a result, the controller may run without a license and thus switches to demo mode, which only runs for two hours.
After that, a manual restart is necessary.

Fieldbuses without license switch to demo mode, which lasts for 30 minutes.

Problem description

The mount of a WIBU dongle only happens with WIBU USB dongles in mass storage mode!

The WIBU runtime does not manage the mount and needs a few seconds more.
Even Linux doesn't have shares in it, it's simply the code meter.

For example, with a Raspi reboot, this is simply too slow / too late until it is recognized.

Simple solution:

  • Activate the license directly on the PLC as a Softlicense.
  • Switch the USB dongle to HID mode (f.e via a "MEM_TO_HID.bat")

    @echo off
    set Path=%Path%;C:\Program Files (x86)\CodeMeter\Runtime\bin\
    cmu32.exe -v"
    cmu32 --list
    :nochmal
    echo Abrechen mit Strg-C
    set /p cmcontainer=Bitte CM Container (Dongle Seriennummer) eingeben:
    if "%cmcontainer%"=="" goto nochmal
    cmu32 /s %cmcontainer% --set-config-disk HidCommunication
    pause

    Then The USB dongle is not mounted and everything works even when the Linux is rebooted.

    These two switches are needed, included in the driver components:

    CONFIG_HID
    CONFIG_HIDRAW

    This is due to the lack of HID support in the Linux kernel.
    This must be changed on the Linux Kernel side.
    So there are no changes needed in CODESYSControl.cfg.

Solution 1:

One solution could be, to start the runtime after the dongle is mounted.

Solution 2:

The second solution could be, to check the "StartDone" event (after a view seconds), and see if the USB stick is mounted.
Perform an AppReset() if the dongle is not found mounted.

This is only a weak workaround.
It is still suitable, if there is just a single application with this problem.

Reference

Examples:

  • CODESYS IIoT SL License not found
  • CODESYS Profiler License not found
  • ...

No, because this can take quite a long time the first time it is executed.
Codesys can not solve this possible mounting with an application approach.

We have therefore included the query in 'call after init' - the problem should rather be solved on the PLC side.
Codesys assumes that the licenses are available at start-up. 




  • No labels