Search the Community

Showing results for tags 'structured function'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Found 45 results

  1. GX Work2 Comments in Arrays

    I am very new to the Mitsubishi PLC world (I have a lot of experience with A/B and Omron though).  I am having an issue trying to assign comments to an array of Globally scoped bits - I am also using Structured Ladder - NOT simple ladder.  Is it possible to do this?  I have contacted there tech support group and they were of little help.  I don't care if I update the label comment or the device comment, I just want to assign a simple comment that can be displayed (i.e. I am using this for step sequences).   Any help would be greatly appreciated!  
  2. 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!!!!!!!!!
  3. 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
  4. Hi. This regards ventilation. A room has two air inlet dampers (pretty much like a big air valve in a ventilation duct). Only one is used at a time to regulate temperature in the room, and the other is then closed. When switching the inlet of air from one damper to another; i have not decided what method to use yet. I consider splitting the regulator output in two and let the one damper ramp down to this value, and the other ramp up.  When these values are reached one ramps up to the full regulator output and the other to zero. Not quite sure this is the best solution, and the code is not written yet :) Anyone done anything similar or has suggestions? Cheers!
  5. Hello:   I need to link  a lot of variables, pointing to CIO address, like "AT" field, but is a large volume of tags to create, so, I have a chance to assign a memory location to a variable in ST like:  my_tag := %100;  (trying to assign tag address to CIO 100) ? If not, there is a method to import tags from a Excel ?   Thanks.    
  6. 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
  7. 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.
  8. Gx Works 2 ve fx2n için bir fonksiyon kütüphanesine ihtiyacım var. Servo ve step motor kontrolü için.   thank you
  9. 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.
  10. Hi, I am searching for a  Possibility to Set bits in Set or Reset State. How can i do that? in Example the Code in LD: and in ST EQ_E( Merker79 AND Referenzfahrt_TP_Ein_Aus = TRUE , bDummy , P_Achse_Istpos_pulse , 0 ); PLS( bDummy , Drehrichtung_P_Achse AND M8140 AND Loeschen_Positionszaehler_Achsen AND Startpos_anfahren_nach_Referenzi AND P_Achse_Referenziert = TRUE );
  11. Hi, I Have some Problems with this Function Block written in Codesys ST: Variables: FUNCTION_BLOCK FB_Powder_Test VAR_INPUT     bEnable: BOOL;     bPowder_On_Button: BOOL;     bPowder_Test_OnOff: BOOL;     iTime_Powdertest: INT; END_VAR VAR_OUTPUT     bReset: BOOL;     iActual_time_powdertest: INT; END_VAR VAR     PowderTest_Ton: TON; END_VAR Function Block: IF NOT bEnable THEN     bReset := TRUE;     PowderTest_Ton.IN := FALSE;     iActual_time_powdertest := 0; ELSE     IF bPowder_On_Button THEN         PowderTest_Ton(IN := bPowder_Test_OnOff, PT := (INT_TO_TIME(iTime_Powdertest) * 1000));         iActual_time_powdertest := REAL_TO_INT((TIME_TO_REAL(PowderTest_Ton.PT) - TIME_TO_REAL( PowderTest_Ton.ET)) / 1000);         bReset :=  PowderTest_Ton.Q;     END_IF END_IF and GX Works3  Variables: bEnable                                  Bit                        VAR_INPUT bPowder_On_Button            Bit                        VAR_INPUT bPowder_Test_OnOff          Bit                         VAR_INPUT iTime_Powdertest                Word [Signed]    VAR_INPUT bReset                                    Bit                        VAR_OUTPUT iActual_time_powdertest    Word [Signed]    VAR_OUTPUT PowderTest_Ton                  TON                     VAR   Function Block: IF NOT bEnable THEN     bReset := TRUE;     PowderTest_Ton.IN := FALSE;     iActual_time_powdertest := 0; ELSE     IF bPowder_On_Button THEN         PowderTest_Ton(IN := bPowder_Test_OnOff, PT := (INT_TO_REAL(iTime_Powdertest) * 1000));         iActual_time_powdertest := ((TIME_TO_INT(PowderTest_Ton.PT) - TIME_TO_INT( PowderTest_Ton.ET)) / 1000);         bReset :=  PowderTest_Ton.Q;     END_IF; END_IF; I have this Error: No.    Result    Data Name    Category    Content    Error Code 1    Warning    FB_Powder_Test    Syntax Check    Convert data type from INT type to REAL type automatically.    0x11042FD4 2    Error    FB_Powder_Test    Syntax Check    Data type of argument does not match.    0x11041F61    
  12. Hi, Many Programms we have are written in Codesys and in ST Language  and now we have a FX5U and I'm trying to Convert some of them. But the both Systems are different, I miss the Librarys like util.lib and FB like RAMP_REAL, BLINK, LIMITERROR which are in Util.lib. Are there Librarys like util.lib for GX Works 3 ? Is it possible to convert Ladder to ST? (I dont have any Idea from Ladder and I'm new in Programming)  Have someone Sample Programms for me for Training?
  13. 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
  14. KEEP in ST

    Hi, I have a fairly easy assignment for a school project that has the following components:  -1 impuls start switch  -1 impuls stop switch  -2 El-motors When you push start one motor is suppose to run. Then you push stop and it stops. The next time you start the other should run. Only one motor shoud run at the time.  I solved this using a KEEP function in ladder logic. But I want to be abel to do the same thing in structured text. So my problem is that I cant fint anything to replace the KEEP function. Any help would be much appriciated.  
  15. Structured Ladder

    Need Help! I uploaded structured ladder program into FX3S PLC. But When I try to read it from PLC it says the program cannot be opened. 
  16. 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
  17. 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!
  18. 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
  19. Hello,  I am working on a project to connect a PLC (Micro820 by Allen Bradley) to a simple RS-232 alphanumeric OLED display. I am not too familiar with structured text language, but I have worked with micro-controllers that use similar high-level languages (mostly C-based).  My question is: is it possible to use connected components workbench to program my Micro820 to output ASCII commands to an off-the-shelf RS-232 alphanumeric display? Are there libraries that make life easier to do this?  I welcome any recommendations to related reference material or command tutorials, thanks!
  20. Converting UINT to DINT

    Good afternoon,   I need to convert a UINT (16-bit unsigned integer) to a DINT ( 32-bit signed integer).   Apparently we can't directly assign a UINT variable's value to a DINT's or vice versa. I also couldn't find a way of casting UINT as DINT.   The reason why I need to do it is because I'm receiving data from a socket. The RXLength is a UINT but in order to scroll through  the data array (USINT[1..1])  I need to use a DINT as the array's index, but I can't compare the array index to the array's length because they are incompatible types.   Is there a cast statement similar to:       myDINTvar := (DINT) myUINTvar;   I also tried the following but it didn't work:       myDINTvar :=  (myUINTvar * 1);   Any help will be deeply appreciated.   
  21. I am very knowledgeable with RSLogix5 and RSLogix500, but want to become well-versed with RSLogix5000 advanced algorithms, strategies, and program types—(Ladder, Sequential Function Charts, Function Block Diag, Structured Text), and motion control, such as servo-controllers. . . mostly interested in structured text. I’m also interested in the nuances of RSLogix5000, ControlLogix & CompactLogix regarding design, on-line programming, and off-line programming, etc. Can anyone recommend a course or courses that cover this subject matter? Thanks!
  22. In Part One of the Question: "Can the Omron NJ CPU make the Random Sea?"     There were some fine opinions about that.   This example is what it looks like using Red Lion, Delta Motion RMC75E and LinMot: Recent edit:  The "Big Trycky Omron Question was asked many, many times not shown on this Forum.   I had a very difficult time getting a straight answer from many people at Omron and LinMot.  Probably because they really never tried to do it.  By  the end of THIS thread ( part2 ), Thanks to innoaloe I know that the NJ can generate the position signal, as streaming position data with no time limit, and produce a "randomly" generated model of the ocean's surface.  The "random" part isn't added yet, but, it will work... and the LinMot part isn't added yet .. and it is still unknown if that will work.            
  23. Hi, can you help me how to make program indirect address for plc omron? I use PLC CP1E Thanks
  24. Hi... Trying to keep it simple: Want to make a G5 incremental motor wiggle, CW/CCW in a sine wave motion, Thought this might work:                                                   The variable,  "Angle" is REAL, Phase1 is REAL, AMP1 is LREAL, CSINE is LREAL .. Sysmac doesn't like "Angle" in the FOR statement .. Anyone know why..? Thanks Much, Regards, Michael
  25. can you help me? bring me some example to build function block program with Gx Works? I use Q02U CPU   thanks