Hallo, I´m having a hard time programming with the PCWorx Engineer.
There are a lot of basic FunctionBlocks/Functions meantioned in the help center and/or selectable in the programming interface, which are not implemented for the PLCnext. Examples: WORD_TO_BITS
When I type this in ST-Code there is a quick help (showing the function arguments order) for it but it is not working. PULSE_GEN
German error msg:
“Die ausgewählte Ressource axcf2152:OLC unterstützt die Programmorganisationseinheit ACTF nicht”
“Die ausgewählte Ressource axcf2152:OLC unterstützt die Programmorganisationseinheit PULSE_GEN nicht” I could add more examples…
Could you help me to find an efficient way to convert a String containing a HEX number to Bits? The String could look like this “input;00C3” and I need to split this into Bits. Converting the String into a Number always converts it from DEZ to whatever. I don´t know how to Handle it as HEX Numbers.
My Workarround in ST is not really efficient:/*parse string: input:0000KOMISCHESZEICHEN*/ > > //cut number from String > str_tmp:= str_in; > str_tmp:= DELETE(str_tmp,6,1); > > //number String to Buf (takes number as DEZ but is really HEX) > b_cpyRdy:= STRING_COPY(str_tmp,buf_tmp,0,4); > r_tmp:= 0; > > //reconvert false DEZ to real DEZ > (* Variable und alle Werte müssen vom Typ INT sein *) > FOR int_i := 0 TO 4 BY 1 DO > int_x:= int_x+1; > CASE TO_INT(buf_tmp[int_i])(* Ausdruck (muss einen INT Wert zurückgeben*) OF > 48: ;//0 -> muss nicht berechnet werden! > 49: r_tmp := r_tmp + 1*EXPT(anyreal16,3-int_i);//1 > 50: r_tmp := r_tmp + 2*EXPT(anyreal16,3-int_i);//2 > 51: r_tmp := r_tmp + 3*EXPT(anyreal16,3-int_i);//3 > 52: r_tmp := r_tmp + 4*EXPT(anyreal16,3-int_i);//4 > 53: r_tmp := r_tmp + 5*EXPT(anyreal16,3-int_i);//5 > 54: r_tmp := r_tmp + 6*EXPT(anyreal16,3-int_i);//6 > 55: r_tmp := r_tmp + 7*EXPT(anyreal16,3-int_i);//7 > 56: r_tmp := r_tmp + 8*EXPT(anyreal16,3-int_i);//8 > 57: r_tmp := r_tmp + 9*EXPT(anyreal16,3-int_i);//9 > 65: r_tmp := r_tmp + 10*EXPT(anyreal16,3-int_i);//A > 66: r_tmp := r_tmp + 11*EXPT(anyreal16,3-int_i);//B > 67: r_tmp := r_tmp + 12*EXPT(anyreal16,3-int_i);//C > 68: r_tmp := r_tmp + 13*EXPT(anyreal16,3-int_i);//D > 69: r_tmp := r_tmp + 14*EXPT(anyreal16,3-int_i);//E > 70: r_tmp := r_tmp + 15*EXPT(anyreal16,3-int_i);//F > //usw A,B,C...F > END_CASE > END_FOR > > int_x:= TO_INT(r_tmp); > w_out:= TO_WORD(int_x);Thanks for your help, Jimmy Pesto