How to Toggle a Bit in Structured Text - PLC Programming Cookbook

Поделиться
HTML-код
  • Опубликовано: 31 янв 2025

Комментарии • 4

  • @sandyjonesmusic
    @sandyjonesmusic 4 месяца назад

    Nice one!!

  • @TheEdmaster87
    @TheEdmaster87 4 года назад

    Hi I am learning PLC programming, especially codesys, I am used to program MCU's like Atmega2560 or ST32 or DSP430 etc.. I use to do it with c++ and I find structured text very similar to C code language but again it is different. If I want to make a state machine with switch case, can I do that in codesys using structured text?

    • @breen-machine
      @breen-machine  4 года назад

      Yes, a case structure is a great way to make a state machine in structured text. Here's an example from Codesys help:
      CASE iVar OF
      1, 5: bVar1 := TRUE;
      bVar3 := FALSE;
      2: bVar2 := FALSE;
      bVar3 := TRUE;
      10..20: bVar1 := TRUE;
      bVar3= TRUE;
      ELSE
      bVar1 := NOT bVar1;
      bVar2 := bVar1 OR bVar2;
      END_CASE;
      Source: help.codesys.com/api-content/2/codesys/3.5.12.0/en/_cds_st_instruction_case/

  • @АлексейА-ы1ь
    @АлексейА-ы1ь Год назад

    How simple)) And how dificult to find this example in ST (SCL)