Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Using Forte with non supported WAGO PFC200 IO modules(How can 4diac be extended to support other WAGO IO modules?)
Using Forte with non supported WAGO PFC200 IO modules [message #1833105] Fri, 02 October 2020 10:56 Go to next message
Sonia Gili is currently offline Sonia GiliFriend
Messages: 1
Registered: October 2020
Junior Member
The WAGO PFC200 IO modules supported by 4diac Forte are the 459, 405_6, 1504_5, and 1506. However, I'd like to use 4diac with the IO modules I already have, which are: 750-430, 750-530 and the final module 750-600.
Can I use these modules directly with 4diac? If not, how can 4diac be extended to support these modules?
Re: Using Forte with non supported WAGO PFC200 IO modules [message #1833164 is a reply to message #1833105] Mon, 05 October 2020 07:40 Go to previous message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
Hi,

you probably won't be able to use the modules using the other FBs . You don't need to do anything with the end module in 4diac. This is just for the hardware.
To extend the other modules the way to do it is:
1- Copy one of the existing FBs modules and change its name (for example Wago1506 -> Wago430) and change the inputs/outpus according to what you have in each module. Leave the events and bus as they are, and then export it as cpp files.
2- In the generated file, you need to do some changes. Copy the first part of other module and paste it there. Which part? The public and protected part, for example

  class FORTE_Wago459: public WagoSlaveBase{
  DECLARE_FIRMWARE_FB(FORTE_Wago459)

  public:
    FUNCTION_BLOCK_CTOR_FOR_WAGO_SLAVES(FORTE_Wago459, 459){
    };

    virtual ~FORTE_Wago459(){};

  protected:

    INIT_HANLDLES(0, 0, 4, 0)


Some things to take care of here:
- Don't change the name of the class, only the inheritance (it should inheritate from WagoSlaveBase. You will need to include this header too)
- INIT_HANLDLES takes 4 arguments, which are the number of boolean inputs, number of boolean outputs, number of analog inputs and number of analog outputs). Use the numbers according to the module
- FUNCTION_BLOCK_CTOR_FOR_WAGO_SLAVES takes two arguments: The first one is the class name, and the second is a number. This number is the tricky part. This is an identifier of each specific module. For the 459 it is the same actually, but for example for the 1506 it is 34831

I was checking the code right now to see if the id is logged, but apparently not. I think there's an error in wagoDeviceController.cpp:init()

  for(size_t i = 0; i < mTerminalCount; ++i) { // find kbus device
    if(0 == strcmp(deviceList[i].DeviceName, scmKBusDeviceName)) {
      mKBusDeviceId = deviceList[i].DeviceId;
      if(0 != mAppDevInterface->OpenDevice(mKBusDeviceId)) {
        DEVLOG_ERROR("[WagoDeviceController] %s \n", scmFailedToOpenKBusDevice);
        return scmFailedToOpenKBusDevice;
      }

      return loadTerminalInformation();
    }
  }

  for(size_t i = 0; i < mTerminalCount; i++) {
    DEVLOG_INFO("[WagoDeviceController] Found device with ID: %d\n", mTerminalIds[i]);
  }



the last for loop which prints the IDs information (which is what you need) won't be executed. So if you move the loop inside the loadTerminalInformation() function before the last return it should work.

What you'll do then is to connect your new modules, and check the log for the ID information. And these numbers you'll use as the second argument of FUNCTION_BLOCK_CTOR_FOR_WAGO_SLAVES
Previous Topic:Condition at ECC Transitions
Next Topic:Couldn't resolve reference to VarDeclaration
Goto Forum:
  


Current Time: Tue May 18 02:20:45 GMT 2021

Powered by FUDForum. Page generated in 0.02125 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top