BITS N BYTES

MrPLC Member
  • Content count

    911
  • Joined

  • Last visited

Everything posted by BITS N BYTES

  1. Ns-10 Operator Interface

    Cannot find a system bit $SB or system word $SW in the System Memory area of the NS-10 to indicates that the display area of the touchscreen has been touched. Any ideas would be most welcome!!
  2. INTERRUPT TIME?

    Using a rising edge hardware interrupt on input 2960.00 in a CJ1M-CPU21 to run an interrupt task. I need to determine the time in milliseconds between each successive interrupt. Since a timer cannot be used within an interrupt task how can I use a high resolution timer TIMHH in a standard cyclic task? Is there a better/more accureate method to determine the time? Are there any flags or values in the A memory area that could be used? Any ideas/feedback would be much appreciated.
  3. LOVE THE AVG[195] FUNCTION - BUT!?

    atanats The AVG instruction will not work with a rising edge input it only works if the input is on. The first work area R+1 uses a Previous Value Pointer [bits 0 thru 7] to fill the data array. This pointer increments with each program scan if the instruction is ON. Once N cycles are complete the average value is determined when bit 15 of R+1 turns ON. I am trying to find a way to increment the pointer independently of program scan cycles!
  4. INTERRUPT TIME?

    Thanks to all for feedback. I liked YAIR's solution the best but since I have already used the timed interrupt for another function I cannot apply it [unfortunately the CJ1M-CPU21 has only one timed interrupt]. Used the PRV function instead as suggested by SLEEPY WOMBAT. The accuracy is not as good but suits my purpose just fine.
  5. NS10 DISPLAY

    I am using a level meter on an NS 10 screen to display the value of a data memory area in a CJ1M-CPU21. The value fluctuates quite rapidly so the level meter bounces around. Have tried using the AVG instruction in the PLC. Needed two AVG instructions both with Number of Cycles set to #0064. This works well but uses up a bunch of memory! Any simple ideas how to stabilize the display from within NS Designer? Would a screen macro be a good choice or is there an easier way? Happy Thanksgiving to All
  6. CJ1-W NC433 Motion Card

    I am using a CJ1M-CPU21 PLC with a CJ1W-NC433 motion card. Step outputs are open loop. When I command an origin search on axis X, origin search works fine and the at origin flag turns ON when the origin is found. When I command an absolute moveon axis X, the move completes correctly and the move completion flag turns ON when the move ends. I am using the origin completion and move completion flags in the PLC logic and in both cases they are recognized and processed by the ladder logic. NOW TO MY PROBLEM When I command an origin search on axis Y, origin search works fine. When I command an absolute move on axis Y, the move completes correctly. BUT IN NEITHER CASE IS THE LADDER LOGIC ASSIGNED TO THESE FLAGS PROCESSED. When I monitor the at origin flag and move completion flags in CX programmer it appears that these flags for axis Y are on [green in ladder monitor]. But they do not process the ladder instruction. ONLY if I force these flags OFF then ON does the ladder work OK. Seems that the processor is not recognizing the at origin or completion flags from the Y axis. It does correctly "see" the ON/OFF states of the origin proximity and origin inputs. What could possibly be the probem - I am really stumped.
  7. CJ1-W NC433 Motion Card

    Found a solution but do not know the reason why? If the ladder logic that uses the flags from the NC433 card are placed in any other task other than TASK0, only the flags for Axis X are correctly processed. If the logic is placed in TASK0 the flags for all four axes work correctly!! Does anyone have any ideas, comments, experience as to why this occurs. This problem has taken the best part of three wasted days to troubleshoot, so a concise answer and/or resolution would be much appreciated.
  8. BYTE to WORD CONVERSION

    Thanks BENNDER! I missed these two useful instructions when I searched the instruction manual for the word "byte". They work just as I needed.
  9. BYTE to WORD CONVERSION

    Need to write the LOW ORDER and HIGH order bytes of a value in a single DM memory word to 2 separate DM words. For example if D0000 = 0241 hex then write 0002h to D0001 and 0041h to D0002. Is there a single instruction that will do this, or must multiple instuctions be used?
  10. CJ1-SCU21 Serial Buffer

    What is the mechanism/timing for data being received INTO the buffer of Serial port and how is this coordinated withthe PMCR instruction? In my application I have a host connection with no flow control. The host can send unsolicited a message or group of messages any time. Each message has the same header and trailer strings. Does/can the serial port receive strings into its buffer prior to a Receive Message being initiated with a PMCR command OR does the buffer only accept data when the PMCR is active? In some cases there is only a single message sent from the host. In this case defining the message string in the text editor is fairly easy. However with multiple messages I am somewhat confused! What structure should be used in a protocol to achieve this. Multiple steps with identical <h> and <t> but different write variables locations! A single step with N iterations and each iteration writing to different variable locations using the N+y in the variable! Should/can the step WAIT feature be used to sequentially read data out of the buffer? I know these questions may be fairly basic to some, but in my case I cannot find any meaningful examples in the Omron manuals [CX Protocol or the SCU21] that provide any meaningful solutions. Any help would be greatly appreciated.
  11. CJ1-SCU21 Serial Buffer

    PMCR I found the same issue through further testing. To resolve the problem I think it will be necessary to have a two character header for each matched receive message. Both macros look for a match using the second character of the header as the <h> in the message structure. The first character of the header is specified as a match in the last "Other" case and points to the start of the second macro. The second macro uses the second character as the header for each of its cases. Using this method the case that switches to the second macro call does not strip data from the receive buffer that needs examining by the second matrix. I'll try this method tomorrow and post results.
  12. CJ1-SCU21 Serial Buffer

    Tested applications today and found your ideas and suggestions worked well. The confusing issue in the matrix cases is that a GO TO # for a matched case goes to the STEP in the routine that calls the matrix, it does NOT move within the matrix cases. Not explained at all clearly in the OMRON documentation. Now to some hopefuly final questions regarding matrices. If the last case in the matrix [15] is set as END does this end just the MATRIX lookup or does it end the complete protocol that called the matrix? If the last case is set as GO TO step # does the matrix end but return to the step defined in the GO TO statement? I ask this question to see whether it is possible to have more than one matrix lookup within a single protocol. This would allow more than the 15 matrix cases to be processed with a single protocol. In other words first step in protocol calls MATRIX A. If any strings are matched in any of the cases within MATRIX A the desired response is carried out. At the completion of MATRIX A a GO TO step is used to call a step in the protocol that starts a new MATRIX B seach. I have run a simple test to try this method, but cannot get it to work. It appears that a matrix case pointer from the first MATRIX A call is being used in the SCU. If I have 4 cases in MATRIX A and 8 in MATRIX B, MATRIX B misses its cases 0 thr 4 and starts at case 4. Is there any method to reset the matrix pointer so that after MATRIX A is complete MATRIX B will start at its own case 0? I have attached a test application:- The SINGLE MATRIX TEST reads the serial buffer for messages A,B,C or D and responds with A REPLY, B REPLY, C REPLY, D REPLY. Any other string returns BAD MESSAGE. The DOUBLE MATRIX TEST looks for a match A,B,C,D in the first matrix and E,F,G,H or any othe character in the second matix. The SINGLE MATRIX TEST works fine. I cannot get the DOUBLE MATIX TEST to function!! MATRIX_TESTS.psw
  13. CJ1-SCU21 Serial Buffer

    GREAT RESPONSE!! Your statement "As soon as the matrix has processed case A, the <h>A:fghdse<t> is removed from the buffer by the SCU. You are left with messages B and C. You do not have to do this manually. Flush is only used to completely clear the receive buffer" is a key point that really clarifies how how the SCU handles data. If the matrix case order was B then C then A would string B be removed form the buffer leaving A and C for the next iteration of the matrix? In other words does a matched receive message remove the matched data from the buffer [wherever it resides] leaving all remaining unmatched strings in the buffer for examining by the next issued PMCR command? I'll try out your applications tomorrow and hope all is answered. Once again many, many thanks for your help and advice. By the way, I have hooked up an interface with hyperterminal to test my application - sending and receiving messages OK. Can you recommend a better/more flexible Serial Terminal Emulation software for testing?
  14. CJ1-SCU21 Serial Buffer

    PMCR Thanx for the response. I am using the latest hardware version of the CJ1-SCU21 so I do have the ability to control flushing of the buffer. What still puzzles me is how unsolicited data is handled under this condition? IF buffer flushing is disabled will the buffer continue to receive new data as it is transmitted into the serial port even though the original data is being processed with a PMCR RECEIVE command? In my example, when a PMCR receive command is active the buffer initially contains:- .........<h>A:fghdse<t>..................<h>B:klsewq<t>.............. If a receive matrix is set up to look for instances of A:[*.*], B:[*.*] or C:[*.*] it will find the first match A:[*.*]. During this event the host sends data for C. Providing a flush command has NOT been issued am I correct in assuming that the buffer now contains the original data PLUS the NEW data? .........<h>A:fghdse<t>..................<h>B:klsewq<t>.............<h>C:123456<t>..... If a flush command IS issued at what point is NEW data written from the host accepted or rejected into the buffer? In other words if the host is sending unsolicited data how can I be sure to capture all data without flushing it out of the buffer? A functional description of the buffer mechanism would be of great help! MATRICES As you state "The SCU will compare the data in the receive buffer with each Receive Message in the matrix in order from top to bottom until the first match is found. When a match is found, the SCU exits the Matrix" What I am trying to do is have the SCU send a message to the host if a match is found in the matrix. Can this be handled solely within the SCU or must there be PLC code that initiates the desired PMCR Send command in response to a match within a matrix? GOALS In general I am attempting to utilize the power of the protocol macros to manage the PMCR Send/Receive messages to the host with a minimim of PLC coding. Each matching RECEIVE case generates a SEND response. If the PCMCR matrix finds a match the desired SEND message is sent, the PCMR then returns to to the matrix, looks up the next matching case and generates another responese etc. etc. If this needs to be handled with PLC code what flags/words are available to monitor a matching matrix case? Once a case is found, if the PMCR calls the matrix again can the case be indexed to the next one through flags/words fromthe PLC? In other words can matrix cases be enabled/disabled via flags/pointers set in the PLC prior to sending the next PMCR comand that starts a matrix search? I will take a good look at your posted Protocol Macro tomorrow. Many thanks for your help.
  15. CX Programmer and CX Protocol

    Is there a method to run both CX Programmer and CX Protocol at the same time? Right now I am using a CJ1M-CPU21 processor with my PC connected to the programming port of the PLC. If I am ON LINE with CX Programmer and need to download a new protocol list with CX Protocol it is necessary to go OFF LINE with CX Programmer and then Connect to the PLC with CX Protocol. Once a Protocol list has been downloaded I must disconnect from the PLC with CX Protocol and go back ONLINE with CX Programmer. A lot of ONLINE/OFFLINE/CONNECT/RECONNECT etc. etc.
  16. CJ1-SCU21 Serial Buffer

    Thanks again Jay - look forward to some answers. To expand further I might receive the following message string in the buffer .........<h>A:fghdse<t>..................<h>B:klsewq<t>.............<h>C:123456<t>..... I need data in A: to move to D100-D102, data in B: to move to D110-D112 and data in C: to move to D120-D122. After reciving this data and processing it with the PMCR I might receive a new string as follows:- .........<h>B:gwityp<t>..................<h>A:lpqys1<t>.............<h>C:k3l5y7<t>..... Once again I need data in A: to move to D100-D102, data in B: to move to D110-D112 and data in C: to move to D120-D122. Hope this helps expalin my dilemna. Thanks
  17. CX PROTOCOL

    Thanks Jay - as always a great help.
  18. CX PROTOCOL

    Can anyone familiar with CX Protocol explain the following questions? 1. Create a Receive message to open the Message Editor. Select a Variable from the Message Editor to open the Channel editor. Within the Channel editor there are three available TYPE selections Read[R], Write[W] and *. For a receive message one normall would want to Write data from the serial port TO the Channel Variable. However the READ selection is possible!! What is the function of the READ selection in a Receive Message? 2. If specifying a Write in the above setup what character can bes used to omit/skip data in the Message statement so it DOES NOT write to the Variable? For example, incoming message is 12:34:56. I need to write 12 to D100 and 56 to D101. Will the following statement achieve this? <h>+W(D00100,2)+"::"+(W(D00101,2)+<t> Thanx
  19. CX Programmer and CX Protocol

    BobB you rock!!! Many thanks for the tip - works great. Yes indeed, the Omron documentation and help is really lousy - BUT their PLC's are amazing!!
  20. CX Programmer and CX Protocol

    No, directly out the Serial port. Have tried using a USB to Serial Converter but cannot get CX-One to work with this configuration!!!
  21. CX Programmer and CX Protocol

    Thanks gtsuport. I am using CX-ONE but have no idea how to implement the method you describe. Any suggestions?
  22. free HMI bitmap or jpeg

    See previous post. http://forums.mrplc.com/index.php?showtopic...&st=0entry149
  23. NS DESIGNER V6.0 - FIXED TEXT

    I am very familiar with the CSV import/export function mentioned by Nibroc. Jay, here is post of screen [if I can get it to work!!!!] Left and Right columns change with language. Other text does not.
  24. NS DESIGNER V6.0 - FIXED TEXT

    I am completing my NS Designer application by adding three more languages [total of four] using the label switching method. Works just fine. HOWEVER! Many of the screens use text that stays the same in all languages. Since the text object is a "Functional object" in NS Designer I must enter the same text four times [once for each language] in the label data for the text object. Is there any other method to generate text that is independent of the label attribute so I only need to enter the label data once? If there is a fixed text object in the NS-Designer application, I just have not been able to find it!! Any ideas please.
  25. ASI Scanner for CJ Series

    Anyone know if there is a third party manufacturer of an ASI scanner for the CJ series PLC's. Have checked the ASI consortium site but found nothing there - only ASI members products are listed.