mike_cheesehead

MrPLC Member
  • Content count

    29
  • Joined

  • Last visited

Everything posted by mike_cheesehead

  1. Data Types- Structure and Union

    If you are new to PLC programming you do not need to use structure text. I find it very complicated. you could do it in ladder.  I am writing code for 2 plc's to talk to each other cj2s and a sysmac NX1  they both send 1 word 16 bits i extract the bits to use them in my ladder program  once you have the union done you can just use the bits of the Array like contacts name_array[bitnumber] u can use them in your program   
  2. Hi there,  because of the delivery problems with Omron CJ series , I am converting programs to the Omron NJ series. But that means going from CX programmer to sysmac studio. I will spare you the cruse words about what i think of studio. Anyway my problem is with timers , under CX programmer you have the TIM(x)  functions I cant find them under sysmac studio . under programmer i could use D words in BCD to write a value to a timer making it flexible. ( The speed of the machine has impact on my set time so that is why the time has to be dynamic)    Timer functions under Sysmac studio use UINT.  That is not a problem i convert the calculations and changed my varible to UINT. But when i use global varible in the timer fuction, it is not happy. can some one point me the way to make a variable timer in sysmac studio?   
  3. How to do timers in sysmac studio

    thanks for the reply yes i could it like that. this also fixed the problem with the timer function why it was spitting errors . Like you said you need to define a local varibale for data. I did not do that because in so many other programs in cx ,  siemens and many other programs . this data is not acceseble and the program does that for you. And i do not know why the F this program doesnt do that for you ... Now i know im using the timer function in my program. Again thanks for the help 
  4. How to do timers in sysmac studio

    thank you for the reply . my error is  Error    1    The input parameter can not be omitted for an in-out variable.    Program1 film_regeling    Row 1 On the PT poort i have variable D52 . Its a UINT global variable . And on the Q i have a Bool global variable   I tryed a static number  like the example  UINT#10 for the PT  but it gives the same error so i ecpect im doing something wrong.. i found a work around do using a TON or TOF but  i cant post screenshots yet. but any way  in STL it reads like this tmpLintVar:=msIntVar*LINT#1000000; msTimeVar:=NanoSecToTime9tmpLintVar); TON_instance(In:Trigger, PT:msTimeVar, Q=>Tout);   Basicly a calculation I multiply my variable with nano seconds then a conversion block NanoSecToTime to create a variable i can use as a time  this variable i can use for the PT  for a Ton/Toff . what a work a round.