BITS N BYTES

MrPLC Member
  • Content count

    911
  • Joined

  • Last visited

Everything posted by BITS N BYTES

  1. FB memory area & counting

    For each ladder FB instance a single NON-RETAIN is automatically assigned to FB memory. For each non-boolean variable an additional NON-RETAIN is assigned. You have one function block instance and four [uINT] variables = 5 NON-RETAIN assigned to FB memory. I don't quite understand why this concerns you? The whole purpose of Function Blocks is that where and how memory is assigned is completely unimportant/irrelevant. Shared FB memory [H memory areas]are shared/reused for each FB instance to save memory usage. Hope this helps.
  2. Cx-P and Function Block problem

    It all depends on what functions you are doing inside the function block!! Furthermore if you are testing the application using CX-Simulator the scan time is way off. Yesterday I tested the same application with CX-Simulator and then on-line with a physical CJ1M PLC. CX Simulator Scan time reported between 27 and 127 mSec. OUCH!! When on-line with real PLC max scan never exceeded 6.2mSec. Post your code.
  3. FB memory area & counting

    Which model PLC? Posting your PLC code will make it easier and quicker to answer your problem.
  4. omron instruction

    AGAIN!! Come on dude, take the initiative and do a bit of your own research first. RTFM http://forums.mrplc.com/index.php?showtopic=6417 Go to Omron Knowledge center and download manual W340 There is an example of EVERY instruction already shown in the Instructions Reference Manual. You will find what you are looking for in the Conversion Instructions Section 3-12 This is the last time.
  5. FB online edit

    Both Structured Text and Ladder functions blocks can be edited on-line PROVIDED THERE IS AT LEAST ONE INSTANCE OF THE FB DECLARED IN A PROGRAM TASK. On-line editing of FB's ONLY works when connected to a physical processor. You CANNOT do any on-line editing of FB's or ST-Tasks in CX-Simulator.
  6. In the operation manual "W447-E1-05 CX-Programmer Ver. 7.2 OPERATION MANUAL Function Blocks/Structured Text" the subject of using IR Index Registers is discussed in Section 2-5-6. I have successfully used IR's in LADDER Function Blocks but cannot for the life of me figure out how to apply them in Structured Text Function Blocks OR Structured Text Tasks. The manual is a bit vague as to whether IR's CAN or CANNOT be used in ST programs. If they CAN there is no clear description as to what syntax is used. Does anyone have any feedback on this issue? Can IR's be used in ST programs? If they can then what syntax is used how and how are IR variables declared? CONFUSED
  7. Accuracy of PLC triggering

    Forget about a "TIMER" within the STI. Use counters/accumulators within the STI and use the STI timebase. For example if the ST is set for 10mSec then when a counter within the STI = 5 then EXACTLY 50mSec have expired.
  8. Accuracy of PLC triggering

    I am not familiar with the ML1100 but if it has the STI [selectable Timed Interrupt] function similar to the SLC500 you can use this to get a very accurate and repeatable time to trigger the camera. Because the STI is asynchronous with program scan you will get no drift.
  9. Call FB in Omron

    YOu CAN certainly call one OR more FB in Structured Text. See Page 210 ,section 5-5 of manual W447-E1-05 OPERATION MANUAL Function Blocks/Structured Text Go here ---> http://www.omron247.com:8085/marcom/pdfcat...Form?SearchView Type in W447 and download manual.
  10. OMRON DEVICE TYPE: CS1H

    Looks like you haven't bothered to stsudy the manuals yet!! http://forums.mrplc.com/index.php?showtopic=6417 Go to Omron Knowledge center and download manual W339 Information you are asking for is there in Section 9
  11. Timer in ST

    OOOOOOoooooo. Love that oneshot!!! much better than mine!!
  12. Timer in ST

    IF NOT Timer_ENABLE (*IF Timer_ENABLE is OFF THEN Reset Timer_DONE and Timer_Preset*) THEN Timer_DONE:=FALSE; Timer_Preset:=0; ELSIF Timer_Preset=5 (*IF Timer_ENABLE is ON AND Preset = 5 seconds*) THEN Timer_DONE:=TRUE; (*Turn ON Timer_DONE*) END_IF; (*Increment timer with Oneshot from 1 second PLC clock bit when Timer_DONE is OFF*) IF P_1s AND NOT Oneshot AND NOT Timer_DONE THEN Timer_Preset:= Timer_Preset +1; (*Incremente*) Oneshot:= TRUE; ELSIF NOT P_1s THEN Oneshot:= FALSE; END_IF; This is ONE way of implementing a TIMER in ST. I am sure there are many others!!! Post your ideas guys!!
  13. OMRON NS- HMI SIMULATION PROGRAM

    CX-Designer has built in TEST [Ctrl+T] features that allow simulation of the NS in one of three modes. 1. Offline 2. Online with a virtual PLC using CX Simulator 3. Online with a physical PLC.
  14. Timer in ST

    Which PLC Model? What kind of timer resolution do you want? You can use the pre-defined External Variables [1min, 1sec or 0.1sec PLC clock pulse bits]. At the rising edge add 1 to a variable in your ST program. Then use comparison to monitor time. When variable has reached a number then timer is done. Voila!
  15. open collector need 2 power supply?

    Corrections above to one of my previous posts. Apologies for error. LD+ and LD- = LineDriver+ and LineDriver-
  16. PLC Cycle time?

    Which PLC?
  17. FB and format type output

    Not sure from your comment if your problem is resolved!! From your picture the function block will pass data from FB Memory to D Memory as follows:- H892 = 0000 00FA. If output is D606 then D607 = 0000 and D606 = 00FA H894 = 0000 00AA. If output is D608 then D609 = 0000 and D608 = 00AA H896 = 0000 64C8. If output is D610 then D611 = 0000 and D611 = 64C8 Are you saying that this is NOT happening? Are you sure you SURE you are not writing to these data areas somewhere else in your program???
  18. FB and format type output

    Without knowing the internals of your function block it looks to me that your outputs D606, D607 and D608 should be changed to D606, D608 and D610. They are DOUBLE WORDS!!
  19. "Instead I get as follows : <h> + (W(DM 0000+1),*) + <t>" Won't work unless you edit the sequence the same as PMCR's. Use the TRACE utility in CX Protocol to "see" what data is being Received/Transmitted on the Serial Port. I cannot stress how important/useful the TRACE feature is in debugging serial communications. Post your traces.
  20. Word Triggered Alarm

    ALARM/EVENTS can only be triggered with a boolean change of state. However you might find this method useful and easier to manage. Each alarm in the PLC simply writes the desired alarm to a single word. Assign a single word in the PLC for your alarms. Set up a project macro in the HMI "When a value changed" to monitor the alarm this alarm word. In the alarm event setting use a series of contiguous HMI bits $B**** assigned to each alarm. The project macro would be similar to this- '*************ALARM/EVENT MESSAGE HANDLER************************************ 'This macro runs whenever value of W100 in PLC changes state 'Boolean Bits $B1000 thru $B1159 generate ALARM/EVENT message in HMI 'PLC writes a numeric value to work word W100. 'HMI decodes numeric word and turns ON bit at desired location. 'For example if PLC writes 12 to W100, HMI will turn on 12th bit $B1011 in HMI 'This will display and record message 12 BITSET ($B1000, 0, 160); 'Clear bits $B1000 thru $B1159 READCMEM ($SW36,[sERIALA:WR00100],1); 'Read alarm message word from PLC WR100 to HMI index register 9 [sW36}. $SW36 = BCD($SW36); 'Convert Index 9 from Decimal to BCD [index registers ONLY work in BCD 0-9999] BITSET ($B1000i9, 1, 1); 'Trigger alarm by turning on single bit at $B1000 with offset Index register 9. My 2 cents.
  21. Rotary position sensor

    Try Cherry - very reasonable cost and tolerant of large misalignment. BUT only 0-5VDC. http://www.cherrycorp.com/english/sensors/an8.htm
  22. HOUR TIMER

    One concept/idea to get you thinking about using CADD(730) - Calendar Add and CSUB(731) functions. Calendar_Example.cxp
  23. HOUR TIMER

    Glad the BIN timer setting helped. The issue of whether to use the PLC clock data is dependent on how you want your system to operate. What are the maximum HOURS value you intend to use? What resolution do you need? If you are only entering HOURS and MINUTES is +/- 1 minute accuracy OK? What do you want to happen if a power loss occurs? Restart timers completely OR finish remaining time? The A351 clock data data can be used within the CADD(730) - Calendar Add and CSUB(731) - Calendar Subtract instructions to give you the results you need BUT all data is in BCD. In your application I would forget the timer instructions. Instead use the ++(590) - Increment Binary or ++L(591) - Double Increment Binary in D memory areas and increment these instructions with the PLC 1-Second clock pulse [CF102] OR the PLC 1-Minute clock pulse [CF104]. In essence you are using an incrementing a data areas using the internal PLC clock pulse. If you prefer/need to decrement then just use -- or --L. You can then use a whole range of comparison instructions to give you Elapsed Time, Remaining Time etc. etc. My 88cents!
  24. HOUR TIMER

    If you want binary values for timers then change the PLC properties to "Execute Timer/Counter as Binary". accessed by Right Click on PLC Icon and selecting Properties. You will then need to change your program to use timers with an X suffix [TIMX, TIMHX etc.]. QUESTION 1?? Before examining your code in detail, are you planning to reuse your function block many times in your program? Seems like an exercise in futility to implement your code in a FB if you only intend to use it once. Just create a task and write it in standard Ladder. QUESTION 2?? Why aren't you using the internal PLC clock data in A351 thru A354 instead of trying to create Hours/Minutes etc. by using timers.
  25. HOUR TIMER

    Which model processor?? Which function block [from OMRON library] OR Homemade?? Post your code!!