Search the Community

Showing results for tags 'how to access bits in word variable in function block??'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Found 110 results

  1. RSLogix5000 Transfer function Bumpless transfer between two inputs. If criteria or FLAG is true, then transfer from input-1 to input-2 at a prescribed ramp rate, and then release the output to match the selected input without rate restrictions.  Issue: The issue is that upon the status of particular input (FLAG), the control valve demand jumps from 0 to whatever the output of the PID’s Low Select value is (maybe 50% or 80% or other). Request: Ideally, I would like to mimic or replicate the Transfer algorithms provided in other control systems, as described below . The TRANSFER algorithm performs a transfer between the two inputs.  The output is equal to the IN2 input if the digital input FLAG is TRUE, and the IN1 input if the digital input FLAG is FALSE.  The algorithm automatically performs a bumpless transfer between the track input and the selected input when a tracking request is removed.  The algorithm ramps to the selected input (IN1 or IN2) at the specified track ramp rate (TRR1 or TRR2).  Internal tracking may be selected to allow a bumpless transfer between IN1 and the IN2 inputs.  Individual track ramp rates may be initialized to ramp from the IN1 to the IN2 and from the IN2 to the IN1. Attached is RSLogix5000 program "transfer.acd" Thanks.
  2. Hello, I am new to automation and I do a project with a Micro850 Plc. I am more comfortable with logic block so I write my program in Function Block langage on Connected Component Workbench software version 12. I would like to make flashing a light but I don't know wich block to use and how to program it ... Could you help me. Thank you
  3. Hello, In past i was using Siemens S7 300 and Simatic 5.3. So a long time ago. I restart look back to plc because i need to monitor the temperature of my heating system. So bought a plc that is a IEC61131-3 standard and  OpenPCS as Develop software.  So i begin to play with OpenPCS because  Im very rusty.  SO i create a function, that i named FC_TEST . When i compile the below code i get an error E: S5004: Function blocks instances are invalid in 'FUNCTION'-POUs, STRUCTs, and in ARRAYs.  It seams that Timer block inside the function FC_TEST are not allowed, i understood right ? (*  --------- DECLARATION  ---------  *) VAR_INPUT T_1 : TIME ; (*Declare T_1 as a Time Input ==> Set the Time of Timer *) START : BOOL; (*Declare START ad BOOL Input ==> Start The Time of the TIMER *) END_VAR VAR MY_TON : TON; (*Instantiate MY_TON as Timer type TON*)  END_VAR (*  --------- FC PROGRAM  ---------  *) MY_TON(IN := START , PT := T_1 ); FC_TEST := MY_TON.Q;   (*  --------- CALL THE FC---------  *) tmp2 := FC_TEST(T#2s, I0_0);  (* I0_0 is a input*) Thanks  Marco  
  4. Dword to Float on FX3GE

    Hello! I have a float number (HEX: 3CA01D0F) in Big Endian. It's 0.0195451062. I get it from the sensor and store it in a double word variable. Could you help me? How can I convert DWord to Float? If i use DFLT instruction, It treats DWord as an integer (1017126159) and just gives me 1.017126 e+009 Thanks in advance.
  5. Hi:         How to use data type Word to perform math function without converting to Int or Uint ?  -----> Error    26    The '+' operator is not supported by WORD data type.     thanks    
  6. Union

    Hello! I am trying to get hold of the bits in a word, i have read that union is the way to go. My problem is that i cant figure out how union works. I have made a union between a word (16bit) and an array(0...15). The way I understood this was that the word now automaticly updates the array so that when the least significant bit in the word should update array[00] and so on. This is not happening. When I monitor the variables I can see the word change, but nothing happens with the array. Have I misunderstood the consept and what should I do to get hold of the bits?
  7. Hello, I'm new to CX-Programming and I could really use your help. I want to make function block that will check the bit status from a word input variable. I made input variable and internal variable array of bool(32) and I thought I can just use the code example: array[1]:=word.1 etc... but it is not allowed in CX-programmer. My goal is rearranging  the bits status from the input word to the output word. I don't need just making the 0 to 1 or otherwise... Thank you in advance.
  8. I'm using simple function block, one input and one output, like in this example: Problem I have is how to call function block and use inverted (NOT) value , ie instead 5.01 I need to use NOT (5.01) . Of course I could create new symbols that are inverted values of actual inputs but i'm trying to avoid that, number of addresses is significant.
  9. Hello, CJ2M CPU-32 to IAI motion controller through ethernet/ip I'm working on programming electric actuators to pick up parts from a tray. I will have x (row) and y (column) coordinates that I need to update to move the actuators. So to go through the whole tray I would have to use nested loops. (below what i'm trying to achieve if i was doing it in C++)                                           6 Rows and 6 Columns, palettizing                                           data rows&columns DWORD (Row1,row2,row3...row6; col1,col2...col6)                                           c++ code                                           for i=0,i++,i<6;                                               rowData = row                                               for i=0,i++,i<6;                                                   colData = col                                                   execute movement                                                   wait for confirmation                                               end                                           end I have a way of doing it but it will require a lot of repetitive lines and typing every step, and I was wondering if there is a way on every iteration to increment the data location instead of the contents. In the picture below you can see the example where the goal is to copy data from D8100 to D8000, then in next step from D8102 to D8000, then from D8104 to D8000 and so on. So far in the documentation I was only able to find how to increment contents. Is it even possible to do what I want to?
  10. To calculate a walking or moving average I want to use WSFT and SUM in a function block. Does anybody have experience with this? The idea is to take a 1 hour average of a proces value and store this average value each hour. The software then have to calculate the walking or moving average over say 4 hours or 12 hours with a maxium of 24 hours. See attached files with logic but then not in a function block     Walking_AVG.cxp Walking_AVG.opt Walking_AVG.bak
  11. I can debug my plc app with simulator. I created some function block, and inside functionblock I can inspect in and out parameters, as well as local variables. But in/out parameters values are not shown. Any solution? Im using Sysmac Studio 1.29.2 and selected a NX PLC in my project.
  12. Modbus fonction block error

    Hi everyone, first time posting here. I've got a problem with the Modbus MTCP-CP1L-Server fonction block. it worked fine for a good amount of time until i try to change an ethernet switch (not managed) on my network. at this moment the fonction block started to give me an error code (2211 ''unit is busy, can't execute''). So i put the old switch back again and I called Omron and they tell me to download Etherway and try to send some data to it but they can't do more. I did and BAM, it worked again. everything was fine for about a week and i was like, okay if etherway can ''solve my problem with the fonction block, i can put the new switch again, No I can't. It give me the same error, I try'd so many thing( put the old switch, everything that was possible in Etherway, change IP address, ethernet setting, reboot everything, connecting the unit direct to my PC. nothing can erase that error.  Unit is an CP1L-EM with built-in Ethernet port did someone had have the same problem, or have any idea that can help me ? thank. Sorry for my poor English, its not my first language.     
  13. Function Block addressing

    Hello all.  I have a program which has 8 function blocks. I recently added extra functionality to one of the programs (not the function blocks). I added the new variables to the global symbols table and added the new code, but when I compiled the new code, the variable addresses in three of the function blocks had changed. This is a problem, because we use memory cassettes to download new versions of code, so when the new version is downloaded to a machine in some far flung part of the world, these variables will be overwritten (they are hours run variable, so are important for servicing purposes).   My understanding is that CX assign's variable addresses in Function Blocks and we have no control over this. Bit if I only added variables to the Global symbol table, why are the FB addresses affected??   Any input appreciated. 
  14. I need to use the usb port from NA HMI to import and export a variable from NX102 to a CSV file. Anyone with a code solution for this? Thank you   
  15. Sample blocks for S7 1200 plc's

    Hi experts, please share the sample blocks for the EDITABLE TIMER block it should be editable from HMI(Siemens). And also motor run hour block. Actually i am having all blocks in tia v12 version and sadly i dont have the old software to convert it again. So please share the blocks that it shoud be work in TIA V14 for s7 1200 plc's. Please note that the blocks should use add instructions to calculate the time because i don't have much memory.
  16. I have a Modicon NOM0200 unit connected to an access switch to send commands to various rs-232 devices. The Access switch requires a "disconnect string" to end communication with a particular port. The disconnect string is "CRTL+D", how can I send a "CRTL" keystroke from the NOM0200 unit? I know for carriage return it is "$R" is their a similar combination I can enter for "CTRL"?  
  17. NB DESIGNER Number Input

    Hello,  I done connect HMI NB7W series to PLC CP1E and just using input and output (0,0 and 100,00) and i can send data from weighing scale to PLC CP1E with RS232 communication. My Question is, if i want to send data from HMI NB7W to PLC CP1E but must input the new data first using number input in HMI NB7W, can i send a new data with RS232 communication (like send data from weighing scale to PLC CP1E)? so i can save the new data to memory in CP1E. I use NB Designer Software and CX Programmer software. If possible, can you tell me how to do it?  Thank you Riandanu
  18. Hi everyone, Using Cicode programming ... I'm try to make a function empressed Button's input command that still running forever until the user press the Button again .. so if i press the Button at first the function inside Button will be running , But i wonder to terminate that function by press same button second time or don't mind if you suppose other Button for stop running the function ... plz help to make a code or something else to stop running of my function.
  19. 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.]
  20. 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?  
  21. Hello! I am using S7-1200 PLC 1212C AC/DC with configured Modbus TCP Server. I can already read/write Inputs/Outputs (Coils) and Memory Words. However I'd like to read/write Memory BITS. Is it possible? If so, how? What addresses should I use in TIA portal? And which function codes on client side? Thanks in advance!
  22. 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?
  23. 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!!!!!!!!!
  24. 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
  25. Good day to all, I am trying to establish DDE communication between my PLC (1769-L23ER) and MS Access via RSLinx Classic Gateway (3.9) over Windows Server 2012 R2.  On my developing PC (Windows 7), there isn't any issue at all. But when I port the codes over to Windows Server 2012 R2, MS Access is not able to establish DDE communications with the PLC.  I was wondering what went wrong. The error message from MS Access is "MS Access can't find the specified application and topic because it can't open the DDE channel, err.Number is 282. The code for getting the channel is as follow OpenRSLinx = Application.DDEInitiate("RSLinx","PLC-D") I was wondering was there anything I have miss out. eg. Configuration of the server, path settings, etc.. Any help is welcome. TIA Cheers CY