Announcement

Collapse
No announcement yet.

send ascii to pc

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts


  • send ascii to pc

    I wrote a click program. Now for example when input 404 is on I want to send to the pc Blender one down for maint. I don`t understand the comunitcation completely I`m fairly new at programming. I`m using co11dd2e-d click plc port 2 is used by hmi so the ascii will be sent via port 3. Example 2 would be if input 405 on send '' blender down electrical ''. Hope this kind of makes sense what we want to do. Thanks in advance


  • #2
    From reading the above, I assume that you have:
    1. A pc with some sort of listening/annunciation software
    2. An RS-485 (adapter/converter/input) module on your pc that will be able to receive these "messages"
    3. Some plc code that handles (or attempts to) some of this.
    4. You want ONE message WHEN an input goes true, not multiple messages WHILE an input is true.
    Please comment on my assumptions.
    Is it a requirement that the messages be ascii? Does your listening software understand other protocols?

    Comment



    • #3
      question 1 yes 2 yes. The plc code is what I`m attempting to understand. The Pc guru here at work told me send him what I want in ascii he will receive and make it happen??? See in my program I have several fault messages example when x101 true I use copy instruction so I copy a 1 to ds1 in cmore hmi the message displayed on the hmi is front left stop depressed. I use this for fault messages so what ever stops the machine the hmi tells the operator. It works great. Now the supervisor wants to see the info at his desk. So I`m trying to figure how to send the message rs 485 from plc to a pc. Another example y002 is on this input goes to copy instruction and sends 2 to ds1 in c-more software 2 message is lack of suction that is displayed on the hmi as look up text. The hmi displays lack of suction. Now the operator knows he she has no suction. Now how do I send that to a pc is the question. Thanks hope I have not confused the issue more if so I can be reached 910-603-40 eight zero. I`m in nc eastern time 12:33 pm now I have 6 machines so supervisor wants look from pc he will know exactly why and how long the machines have been idle

      Comment



      • #4
        First, ensure that you have your COM Port 4 setup for ASCII Protocol.
        Pick baud/data config (sync with adapter/converter/PC settings)
        In program, make some comparisons:
        Try something like this
        Code:
        .
        .'CodeToSend is a DS register value
        .'Send_A_Code is a flag to remember that a code needs to be sent
        .            CodeToSend      1                              Send_A_Code
        .--------+---------------]=[----------+-----------+-------------(S)
        .        |   CodeToSend      2        |           |
        .        +---------------]=[----------+           +--------------+ Copy
        .                                                 |              | Source         CodeToSend
        .                                                 |              | Destination    DS1
        .                                                 |              +-------------------------
        .                                                 |
        .                                                 +--------------+ Copy
        .                                                                | Source         0
        .                                                                | Destination    CodeToSend
        .                                                                +-------------------------
        .                                                 
        .                    Send_A_Code 
        .------------------------]^[-------------------------------------+ Send
        .                                                                | Port 3 ASCII
        .                                                                | (o) Static Test Message
        .                                                                |                          (EMBED A MEMORY ADDRESS) 
        .                                                                |     DS1
        .                                                                |                          (EMBED optional termination codes) 
        .                                                                |                          (select Sending and Success bits) 
        .                                                                +--------------------------
        .
        .                                                           Send_A_Code
        .---------------------------------------------------------------(R)
        .
        .
        Note that I did not include any port ready, error, timing or interlocking. I will leave that to you.

        Comment



        • #5
          Ok I don`t have the experience at this time to make sense of this. I`m new to this. Programming for machine operations I`m good at but moving files and registers going take some homework. I thank you for your efforts.

          Comment



          • #6
            Any example click programs out there that will help?

            Comment



            • #7
              Originally posted by Reel-Break View Post
              Ok I don`t have the experience at this time to make sense of this. I`m new to this. Programming for machine operations I`m good at but moving files and registers going take some homework. I thank you for your efforts.
              just enter it as posted.
              see if it sends a 1 when you put a 1 in DS1
              see if it sends a 2 when you put a 2 in DS1

              it should clear out the desired 'code' when sending
              it should be self-resetting

              the blue text is just descriptive

              Comment



              • #8
                OK can anyone send me a example program how to send simple text from port 3 ascii. I`d like the text to say Blender. I`m having troubles getting my head wrapped around this. I have never done ascii before But I just need set up plc to send the text and someone who does the pc programming will handle the text.

                Comment



                • #9
                  I tried to post a pic to your chat.. forum cr@pped put on me again. smh
                  maybe later i'll post the ascii art of the instructions.

                  [edit] r
                  Last edited by kewakl; 05-21-2018, 05:24 PM.

                  Comment



                  • #10
                    This project [tested] will send a selection of text messages from Port3 of one CLICK to Port 3 of another CLICK.
                    The message will either turn on an output or turn off an output.
                    I did not include any documentation, but it should be evident what is happening.
                    Attached Files

                    Comment



                    • #11
                      Thanks I`m reviewing it now. I really appreciate your help. I`m learning and no one here is really much help. Thanks again Its great for you to take the time for others sharing the knowledge some people don`t get it. When I set up port 3 I got messages about the quotations not correct '' ''.

                      Comment



                      • #12
                        Ok I tried changing the message and still get OBJ-031'' ''. I`m thinking it doesn`t like my quotation marks.Maybe that's my issue

                        Comment



                        • #13
                          Guess what I just found out that I didn`t do the quotations correctly I was doing 2 single quotes .I did not shift quote. Thanks I feel really stupid but now I can move on

                          Comment



                          • #14
                            Click image for larger version

Name:	1864gh5oo8dpojpg.jpg
Views:	1
Size:	13.4 KB
ID:	113499
                            That feeling when..... you find your own stupid mistakes.

                            Get used to it. Learn from them.

                            Glad you got that going. Does the PC app receive and interpret the messages correctly?
                            Last edited by kewakl; 05-22-2018, 08:51 AM.

                            Comment



                            • #15
                              Originally posted by Reel-Break View Post
                              I`m learning and no one here is really much help.
                              I hope that that feeling passes.
                              Others may not have done much serial-ASCII from CLICK --- or are too busy with their own project load to be able to contribute.
                              Usually people don't just respond with a "Don't know how to ..." as it is not really helpful.

                              Originally posted by Reel-Break View Post
                              Thanks again Its great for you to take the time for others sharing the knowledge some people don`t get it.
                              Just trying to pay back some of the excellent help that I have received here.

                              Comment

                              Working...
                              X