Split registers in Variables

Split registers in Variables

  • 20 March 2013 at 1:35 pm #21068
    l.bataller
    Member

    Dear all,

    I would like to split a register (Word- VAR00001) in 16 variables (bits VAR00002, VAR00003…) as I would need to get these variables for use they in other part of the project.
    The way VAR00001.1, VAR00001.2, … is not enought, is neccessary create new variables for each bit.

    Thanks in advanced

  • 22 March 2013 at 11:02 am #21069
    Maverick
    Participant

    Hi,
    as far as I know you can’t do that with a embedded function in Movicon. I have always used the function VAR00001.0,VAR00001.1, VAR00001.2 because i use that to pack ‘bits’ in a same variable to optimize the communication.
    I think you could create a VB code to extract the information reading it from the resource projectname.movrealtimedb present in the Project Folder.

  • 27 March 2013 at 5:26 pm #21070
    jziguiri
    Participant

    If you really need a variable for each bit, you could use a VBA script that executes at startup and keeps running updating your variables. If you don’t need a really quick refresh you can sleep the script between cycles.

  • 5 April 2013 at 5:05 am #21071
    peidi
    Member
    l.bataller wrote:
    Dear all,

    I would like to split a register (Word- VAR00001) in 16 variables (bits VAR00002, VAR00003…) as I would need to get these variables for use they in other part of the project.
    The way VAR00001.1, VAR00001.2, … is not enought, is neccessary create new variables for each bit.

    Thanks in advanced

     do you need to split many register (word)??
    I use ‘Events’, VAR00001.1 on change , VAR00001.1 : move value to VAR00002(Bit).

You must be logged in to reply to this topic.