Attach method missing function call in MBed Studio 1.4.0

no function member for "attach " call in Ticker or Timeout. for X_PLC01A1 ST Microelectronics board in MBed Studio v 1.4.0

Hello,

You probably mean this component/extension board - X-NUCLEO-PLC01A1 Programmable Logic Controller | Mbed

However your informations are weak

  • MbedOS version?
  • Target/board?
  • A printscreen of the error would be nice

Ticker - API references and tutorials | Mbed OS 6 Documentation
Timeout - API references and tutorials | Mbed OS 6 Documentation

BR, Jan

@semicon ,

What board are you connecting the X-NUCLEO-PLC01A1 to?

Ok.“Mea Culpa”.
target boards - : nucleo - STM32F401RE - MB1136 and X-Nucleo - PLC01A1 extension board.
MBed Studio : version 1.4.1. on windows 10. Here there is a lightshot of errors with from HelloWorld_PLC01A1 example project from GitHub.

Try to replace

timeout.attach(this, &XNucleoPLC01A1::handle_freeze_to, msec/1000);

with

timeout.attach(callback(this, &XNucleoPLC01A1::handle_freeze_to), (std::chrono::microseconds)(msec*1000));

Since the second argument should be a time in microseconds the correct conversion from milliseconds to microseconds is msec*1000 rather than msec/1000.

Hello,

the problem is the library is old and it was not updated for MbedOS 6+.

Two options:

  1. When you will follow what compiler says (errors) and check latest docs of Mbed Os you will found what is need to be changed.
  2. Downgrade the MbedOS to version 5.15 and use original.

BR, Jan

Hello

could you please check the latest version of the library X_NUCLEO_PLC01A1 ?

Kind regards
Andrea

1 Like

Hi

HelloWorld application for the component updated, as well.

Kind regards
Andrea