Cicode Genie

hello,

i am trying to make a Cicode genie for a IF function.

so far this is the cicode i have:

FUNCTION KmrBzttngRichTextFileOpen()

IF +bsKmrNrRTF=1

THEN

DspDel (+AnNr)

+bsKmrNrRTF=0

ELSE

PageRichTextFile (+sAnNr, "D:\CtKamerBezetting\"+sAfdlngRTF+"\"+sKmrNr+".rtf", 2, 200, 275);

+bsKmrNrRTF=1;

End

End

so far most of it i got to work, both the path and the AnNr work.

how ever i cant get the "bsKmrNrRTF" to work.

the idea is that when i press on a grapical genie i put in a variable tag that has to be put in place of the "bsKmrNrRTF".

BsKmrNrRTF is at the moment a LOCAL INT adres.

but has to be replace with a Variable adres that gets its value from the PLC.

i wonder if there is a way to make this work? and what i could do to sort this?

thanks in advance.

Arriën

Parents
  • this is where i run into difficulties,
    i want to use a genie in run time to define the strings since i have 13 rooms on each page that each has its own RichText file.

    (this is an example of what is in the genie)

    RstKmrNrRTF="Tr1RtfRst";
    sAfdlngRTF="Tricht1"
    sKmrNr="Tr1Kmr4"
    bsKmrNrRTF="Tr1Kmr4Rtf"
    sAnNr="300"
    KmrBzttngRichTextFileOpen()

    all these tags are local variable but are forced to be used as a STRING data type duo to that i need the strings from the genie used in the cicode.

    so the issue i end up with is that in the Cicode

    FUNCTION KmrBzttngRichTextFileOpen()

    IF bsKmrNrRTF = 1 <---- here bsKmrNrRTF is a string so it will give a invalid types error.
    THEN
    DspDel(AnNr);
    bsKmrNrRTF = 0;
    ELSE
    ----------------------------------------
    and this is where i get stuck.

    bsKmrNrRTF has to be a string so i can make the Cicode read it as a other tag useing the bsKmrNrRTF="Tr1Kmr4Rtf" from the genie in runtime.
    but as soon as bsKmrNrRTF has been defined as (in the example) "Tr1Kmr4Rtf" i need it as a INT.
    (Tr1Kmr4Rtf is atm a local INT)

    is there a better way to do this, or are there possible any ways around this?
    so far all i know about Cicode is what i learnd trough trail and error and self studie of it.

    thanks in advance,

    Arriën
Reply
  • this is where i run into difficulties,
    i want to use a genie in run time to define the strings since i have 13 rooms on each page that each has its own RichText file.

    (this is an example of what is in the genie)

    RstKmrNrRTF="Tr1RtfRst";
    sAfdlngRTF="Tricht1"
    sKmrNr="Tr1Kmr4"
    bsKmrNrRTF="Tr1Kmr4Rtf"
    sAnNr="300"
    KmrBzttngRichTextFileOpen()

    all these tags are local variable but are forced to be used as a STRING data type duo to that i need the strings from the genie used in the cicode.

    so the issue i end up with is that in the Cicode

    FUNCTION KmrBzttngRichTextFileOpen()

    IF bsKmrNrRTF = 1 <---- here bsKmrNrRTF is a string so it will give a invalid types error.
    THEN
    DspDel(AnNr);
    bsKmrNrRTF = 0;
    ELSE
    ----------------------------------------
    and this is where i get stuck.

    bsKmrNrRTF has to be a string so i can make the Cicode read it as a other tag useing the bsKmrNrRTF="Tr1Kmr4Rtf" from the genie in runtime.
    but as soon as bsKmrNrRTF has been defined as (in the example) "Tr1Kmr4Rtf" i need it as a INT.
    (Tr1Kmr4Rtf is atm a local INT)

    is there a better way to do this, or are there possible any ways around this?
    so far all i know about Cicode is what i learnd trough trail and error and self studie of it.

    thanks in advance,

    Arriën
Children
No Data