Search the Community

Showing results for tags 'function blocks'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Found 58 results

  1. Optimized Blocks

    Hello everyone, Are there any alternatives to WinCC at the moment that can handle using optimized blocks. In most other SCADA software, while importing tags, the option to optimize blocks should not be selected as they cannot import in this format. Ignition by Inductive Automation has a driver that can be purchased to solve this problem. I wanted to know if there are some other solutions to this issue.  Thanks!
  2. Pointer Device memory

    To those who don't know the GX Works2 compiler treats any function block referenced used in your code as a place to copy the entire set of code data into your program. Function block calls are not handled like pointers even though the should be. [You'll consume all your pointer space by thinking function blocks are great.]
  3. Hey, I recently started trying my hand at creating function blocks. At the moment I'm trying to create a PID function block, however I keep getting this error: "ERROR: Variable does not have enough size." No idea why it does this. Can anyone help?  
  4. Internal function block variables

    I have a function block where the first internal variable is showing as address H1420 in the Global Symbol table. When I add another retained variable to the function block then save and compile the code, the variable address in the global symbol table shifts from H1420 to H1488.  I need to retain the address as I will be downloading code and I need to ensure the address if H1420 stays with that variable.    Can anyone help with this?
  5. Omron Function Block variables

    Hello all.  I posted earlier in the week regarding downloading new code to an Omron PLC, but I think the question was a bit vague. As a follow up, and hopefully to clarify, I have the following query. I have created an upgraded program which will be downloaded by field techs using memory cassettes. The revised area of code is essentially a Function Block which amends service lamp behaviour, and in creating it, I have amended the existing function block and added new Internal variables. Is there any way I can ensure that the new variables don''t over write or move the existing  variables in the PLC, because this is what is happening when I download it.    HELP!!!!!!!!!
  6. hello.   I've been trying to communicate this omron plc CP1L-EM30DT1-D, with a yaskawa inverter cimr-vu4a0004faa. but i can't figure out how to make de correct mov or configuration in de DM. i need to run/stop, change frequency.    some help, please. :) 485PRUEBA.cxp 485PRUEBA.opt
  7. Hello all. I have been working with an SLC 5/04 system, which houses various Digital and Analog INs and OUTs, up to Slot 29. I am currently mainly working with Slot 25, an Analog Input: 1746-NI16I. This is a system which has already been set up and has been running for the best part of 8-10 years. This particular card has had some spare inputs, one of which I am trying to connect to. In the Advanced Configuration, only a few Channels are actually "Enabled", and each channel is pretty much slightly different from another in terms of Input Type, Filter Frequency and Data Format. I am trying to set up Input 14, which is Channel 15, to "Enable" it, 4-20mA Input Type, Filter Frequency of 6 Hz and Data Format of either Raw/Proportional or Engineering Units. Now, after I have made my choices, I click apply, and then OK. I am then confronted by a pop-up which states: "Configuration Rung and Data Integer Data File Number: 25 Integer Data Element: 100 Rung to be inserted: XIC S2:1/15 COP #N25:100 #O0:25.0 24 At Program File Number: 4 82" I have the options of OK or Cancel. If I click OK, I now have LAD 4, Rung 82 Highlighted. This First Scan Bit and COP function were already here, but does that mean I have now altered what is being written to "#O:25.0"? I now Download the Changes. However, after all this, I am not getting any Analog input reading coming in from the Live PLC. What is this COP function? What does it do? How do I properly set up this Analog Card?   Thanks for your time, -Jame
  8. Hello. How can I get bit addressing of defined variable in function block? For example: - I define variable type DUINT with name Double_VarI_INT. - I want to get or set one bit out of it (its double word). - If I use Double_VarI_INT.0 I got error. Best regards.
  9. Gx Works 2 ve fx2n için bir fonksiyon kütüphanesine ihtiyacım var. Servo ve step motor kontrolü için.   thank you
  10. Struct as FB input

    Hello,  I am trying to define a struct as an input variable for a Function or Function Block. For example the function AddDelimiter (This is a standard Sysmac function), has a input variable with the variable type Struct, an it is possible to couple a struct to this input (See picture below). If i try to make my own function block with a struct or Structure as an input data type, i get the following error (See picture below). When I try to define a struct from the data types (In this case struct: Test) it doesn't give a error. But when I try to couple a struct to this input, that is a layer deeper than the function block struct i get the following error (See picture below). How can i define a struct as an function/ function block input? Thanks in advance.
  11. Anyone ever used a Wait-for digital tag in a C Program? I have to use C in the Red Lion Programs.. but, I'm not at all proficient in C (or anything else for that matter ..) Here’s a nice problem for basic C programming .. I really need to solve it .. but, so far ... can't ... sigh!: I have an actuator that will be commanded to make sine wave motion.  The program that does that, in the actuator’s driver-controller, requires the actuator to first be in a zero position.  Homing has already been done, so the drive knows where the actuator is.  I cannot modify the sine wave program; but, can command a Move Absolute program in the drive, to take the actuator to zero, if it isn’t already there.  When the actuator is at zero, it is “In position” and a digital tag will go True. If the Tag is False, the actuator is not at zero, it’s at some other position,  and only the Move Absolute program can return the actuator to zero. So, when launching this position command program, In a Red Lion G3 HMI, using only Basic C programming, how would you write a control program that would test the status of the actuator’s position, and, finding it at zero (the “InPos” tag is true) would start the Sine Wave program.  And, If the “InPos” Tag is false, would start the Move Absolute program, which would return the actuator to zero, and when the actuator is In Position, would start the Sine Wave program. Here’s the tricky part. It will take only a few milliseconds to start the Move Absolute program (if required) .. but how do you get the “C” control program you are writing, to wait until the actuator actually reaches zero, and the “inPos” tag goes true … which could take several seconds? I don’t believe there is a WaitFor function in “C” , and you cannot send either the Move Absolute, or the Sine Wave program more than once .. so, if a loop is used, it can loop only one time .. presumably with conditional delays. (however that's done)  You cannot use Sleep().. that would be cheating.. the full program must run in the least amount of time, and you do not know how far the actuator is from zero. You could use if (! InPos) or if (InPos) to qualify what programs to run .. but, where does the “Wait for In position”  fit into C Programming?  You might be able to use Continue .. but, ya still have to wait for “InPos” to go True…..before running the Sine Wave.       Thanks Much, Regards, Michael
  12. Profibus Function Blocks for Q2ASCPU for Melsec ST Lite RIO inter-connection. Please assist in advising the attainment of such blocks - if any existing. Thanks
  13. Hi All, I'm still quite new to Unity and Modicon PLCs. I have a PLC program running in simulation mode for development/test and I'd like to follow the logic inside a running block. I can't seem to just double click the function block while online to see it's 'inside' logic. Is there a way to inspect the inside of a running function block? How can I check and diagnose the logic a running function block? Thanks!
  14. ESATR / EGATR Commands

    Good morning folks, I've browsed this forum often enough over the past few years that I think it's time I finally signed up.  Lots of good ideas and advice that I've benefited from and I hope to return the favour some day. So on to my question.... I'm currently knee deep in a project using a CJ2M PLC and I have to send and receive chunks of data over Ethernet/IP.  To do this, I'm using the ESATR and EGATR commands (set / get attribute).  I would like to know if these commands finish execution (ie. the ethernet port completes the transaction) even if the input conditions to the command are no longer true.  Specifically, if I use the "port ready" system flag (A202.00 is an input to my FB in this case) as a condition to trigger the ESATR command, this bit will go low once the port becomes busy (ie. during execution).  So will that interrupt the completion of the ESATR command resulting in an incomplete transaction and data loss?  I've looked through the help files on the command but don't get a clear picture of how it behaves. Perhaps the attached JPEG shows more clearly what I mean. Thanks, PC
  15. Hi, can you help me how to make program indirect address for plc omron? I use PLC CP1E Thanks
  16. can you help me? bring me some example to build function block program with Gx Works? I use Q02U CPU   thanks
  17. where are the FB libraries

    Hello, Im looking for the in built function blocks, but i cannot find it in the program files/ omron folder where the manual says (even with search for *.cxf), perhaps i dont have it installed, but where can i get them from? As i remember i downloaded cx-one from the official omron web page after login etc, so thats why i dont understand why am i missing the fb libraries What else place there is to find useful FB-s? Thanks!
  18. Hello.   A colleague sent me a screenshot (attached) with a peculiar issue. An ADD function that only sends 0 as the outcome, and a DTOS function that only sends " . I have confirmed that all variables used in the ADD block are declared as integers, and both SumInt6 and String10 are not currently being modified somewhere else.  This impatient colleague is baffled, while I am just sharing this issue in the hopes that someone will eventually come with the simple answer that we are overlooking, or a complex one that we could never hope to realize by ourselves.   Thanks in advance.
  19. Unable to Monitor in GXworks2

    Hi! Anyone can help regarding this issue. I'm not able to monitor the Motor Block that I have created. there's no error either in the output screen but i'm thinking what is the cause of not running in the simulation which shows the Motor Folder RED  even it was compiled. thanks for the help!     Note: I'm new in mitsubishi.
  20. Function block self-made

    Hi, i want to make a function block which will contain a block GP.CPRTCL (for predefined comm protocol). GP.CPRTCL has an input "Un" who only receives constant (H,K). On input of my own function block i can set a constant variable, but inside block that variable isn't a constant anymore (GP.CPRTCL doesn't recognize a variable). Is there a way for receiving constant variable in GP.CPRTCL block ("Un") if it is in another block. Regards
  21. Hello. I'm trying to use index addressing inside function block.  The command *D200 doesn't work. Is it necessary to use IR0, ID0,... inside function block? Thanks. Best regards
  22. in Citect i use the following function to associate various Tags with the next popup window, in the previous versions the tags passed to the trend fine since upgrading to 7.4 the trend pens dont display but all the values display fine.  FUNCTION // function AssPIDPopup // Expand a full set of PID tags and open // the PID block supergenie AssPIDPopUp(STRING sSGenie,STRING sBasePIDTag)     AssVarTags(-2,0,sBasePIDTag + "_PV");      AssVarTags(-2,1,sBasePIDTag + "_SP");      AssVarTags(-2,2,sBasePIDTag + "_OP");      AssVarTags(-2,3,sBasePIDTag + "_MAN");      // Now the tags for the PID tuning SG     AssVarTags(-2,4,sBasePIDTag + "_KP");      AssVarTags(-2,5,sBasePIDTag + "_KI");      AssVarTags(-2,6,sBasePIDTag + "_KD");      AssPopUp(sSGenie);      END I added a button to run the following code FUNCTION Loadtrend()     TrnSetPen(19, 1,  AssInfoEx(1,0));     TrnSetPen(19, 2,  AssInfoEx(2,0));     TrnSetPen(19, 3,  AssInfoEx(3,0));     Prompt("Test");      END     when clicked the pens set to the trend fine, i tried to run the code from a function but it did not work. i am new to citect and am sure i am missing something stupid.
  23. There are a lot of instructions in function block that are missing the enable input that is present when programming in ladder logic, such as  ADD or MOV.  It seems to be very limiting. The only way around it that I know of is to write your own function block in ladder logic or statement list and use that. I seems rather limiting of a language if it relies on other languages for it to be usable. Does anyone know why the enable bit was left out in many function blocks when it is so useful in ladder logic? Pat
  24. I'm having trouble with some very basic programming using function blocks. Specifically Connect Components FB programming, but I think it is a general, common application. Using ladder logic, it is easy to set a value based on the status of a bit. If the bit is false, move a zero into the variable. If the bit is true, move and 88.0 into the value. This relies on the enable bit of the mov instruction in ladder logic. Many function block instructions do not have enable bits. How would I change the value of a variable based on the status of a bit using function block programming? A real world example: You have a two position selector switch. If it is turned to the left, the drive runs at 0 Hz. (off) if it is to the right, it runs at 88.0 Hz. Or if you have a 4 position selector and want to select between 4 speeds. This should be a simple task, right? I've called the tech connect support line a few times and sent them a few emails and they haven't been able to figure it out. This is such a basic task. Thanks, Pat
  25. Hi there I'm an embedded software engineer mostly programming C/C++ in Linux and have very little knowledge of the PLC environment.  Recently my attention was diverted towards integrating C/C++ (Linux software) into PLC and then presumably as a function block which is supported with something called PLCOpen. Is that right ? How is multithread support in PLC in general ? and/or with the these function blocks or what ever might become instead when integrating/porting C/C++ code into PLC.  The current situation is purely embedded Linux environment with open-source 3rd party userland that our code relies heavily on. How feasible is to port such environment over to PLC (given that the system supports it) ? I've been looking into B&R Automation Studio 4 and having a hard time to establish concrete feeling on how difficult/easy it is to port the code.  Hope anyone can give me a slight insight into this.  Kind regards Einar