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
  • hey eric,

    currently i use 2 cicode programs useing your advice,
    so i was wondering if you could help me with a adjustment to it.

    these are the current programs i use:



    ----------------------------------------
    STRING msCurrentFile = "";


    FUNCTION RtfOpen(STRING sAfdlingRTF, STRING sKmrNr, INT hAN)

    IF msCurrentFile <> "" THEN
    DspDel(hAN)
    msCurrentFile = "";
    ELSE
    msCurrentFile = "D:\CtKamerBezetting\"+sAfdlingRTF+"\"+ sKmrNr+".rtf";
    PageRichTextFile(hAN, msCurrentFile, 2, 200, 275);
    END
    END
    ---------------------------------------

    FUNCTION Rtfsave(STRING sAfdlingRTF, STRING sKmrNr, INT hAN)

    IF msCurrentFile <> "" THEN
    DspRichTextSave(hAN, msCurrentFile)
    DspDel(hAN);
    msCurrentFile = "";
    END

    msCurrentFile = "D:\CtKamerBezetting\"+sAfdlingRTF+"\"+ sKmrNr+".rtf";

    END
    ------------------------------------------


    these 2 programs are running behind the same genie under 2 buttons, 1 is to just open/close. the other is to save and close the opend display.

    i was wondering if its possible to merge these 2 programs into 1? i have tried some things but without succes.
    they work as they are, its just that you often have to press the buttons twice (duo to the state of msCurrentFile at that time).

    (sorry i find it pretty hard to properly explain it in a understandable way)

    _____________________________________________________
    i have 2 buttons.
    button 1: open/close.
    button 2: save AND close.

    the cicode for these 2 buttons i have put up a bit above this.

    after i have used button 2, i need to press button 1 twice before a new display is shown, is there possible a way around this?


    i know i ask some quite specific things now and stuff that might take quite some time. so dont feel forced or obliged.

    Arriën Duinkerken
Reply
  • hey eric,

    currently i use 2 cicode programs useing your advice,
    so i was wondering if you could help me with a adjustment to it.

    these are the current programs i use:



    ----------------------------------------
    STRING msCurrentFile = "";


    FUNCTION RtfOpen(STRING sAfdlingRTF, STRING sKmrNr, INT hAN)

    IF msCurrentFile <> "" THEN
    DspDel(hAN)
    msCurrentFile = "";
    ELSE
    msCurrentFile = "D:\CtKamerBezetting\"+sAfdlingRTF+"\"+ sKmrNr+".rtf";
    PageRichTextFile(hAN, msCurrentFile, 2, 200, 275);
    END
    END
    ---------------------------------------

    FUNCTION Rtfsave(STRING sAfdlingRTF, STRING sKmrNr, INT hAN)

    IF msCurrentFile <> "" THEN
    DspRichTextSave(hAN, msCurrentFile)
    DspDel(hAN);
    msCurrentFile = "";
    END

    msCurrentFile = "D:\CtKamerBezetting\"+sAfdlingRTF+"\"+ sKmrNr+".rtf";

    END
    ------------------------------------------


    these 2 programs are running behind the same genie under 2 buttons, 1 is to just open/close. the other is to save and close the opend display.

    i was wondering if its possible to merge these 2 programs into 1? i have tried some things but without succes.
    they work as they are, its just that you often have to press the buttons twice (duo to the state of msCurrentFile at that time).

    (sorry i find it pretty hard to properly explain it in a understandable way)

    _____________________________________________________
    i have 2 buttons.
    button 1: open/close.
    button 2: save AND close.

    the cicode for these 2 buttons i have put up a bit above this.

    after i have used button 2, i need to press button 1 twice before a new display is shown, is there possible a way around this?


    i know i ask some quite specific things now and stuff that might take quite some time. so dont feel forced or obliged.

    Arriën Duinkerken
Children
No Data