Showing results 1 to 5 of 5

Thread: Get a bit from a DINT

  1. #1
    Join Date
    26.02.2021
    Posts
    17

    Default Get a bit from a DINT

    Hi everyone, 

    I have a prjetc where the PLC sends me the infrmation of sensor status, alrms... within DINT variables that I need to chop/split somehow to get the value separetely of each of the bits of the DINT. How can I do that whithout any script or so? its some sort of configuration of the variable, create it as a data type... ?

    Any help will be great. thank you all.

  2. #2
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    971

    Default Re: Get a bit from a DINT

    you can make variables 'externally visible' for zenon Logic and evaluate there. For more hints try the Forum Search for keywords: externally visible.

  3. #3
    Join Date
    26.02.2021
    Posts
    17

    Frage Re: Get a bit from a DINT

    Thak you for your reply,
    Unfortunately my client is not paying for the Logic license, so I need to find the way through the editor tools. There isn't a way to refer to a specific bit of a DINT (or even a DWORD) by addressing? like:

    dint var1
     
    bool var1.x

    or even in the variables set up?

    Thank you

  4. #4
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    971

    Default Re: Get a bit from a DINT

    native in zenon: API (programming interface) or, by limited quantity of variables the MATH driver

  5. #5
    Join Date
    26.02.2021
    Posts
    17

    Frage Re: Get a bit from a DINT

    Hi again,

    I keep having aproblem with this. I can read bit by bit from a DINT variable the combine element wroks fine for that. But I have no clue how to write bit by bit into a DINT variable. 

    I have to send to the PLC an initial configuration of the machine within a DINT, something like:

     01001001000110011001100000011010

    I have to make sure the activation of a specific bit do not change the value of any other, or if does, just the required ones.
    I have tried with a Matrix reaction, but I'm not sure how to make sure it sets the values to the variable to be read in the PLC.

    Any help will be highly appreciated!!!

Similar Threads

  1. Local Day Time in format DINT
    By markusw in forum Engineering Studio Logic & Logic Service (former zenon Logic Workbench & Runtime)
    Replies: 0
    Last Post: 12th October 2007, 09:53

Tags for this Thread

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •