none
how to give ascii data input to 'serialcom service' in vpl(4 beta) to talk with mc?

    Dotaz

  • how to give string (ascii data) input to the 'serialcomservice' block in vpl? I read a lot of forums but what i found was about "serialportservice" from promrds for vpl(2008) and has lot of changes. Help contents, tutorials also have nothing practical about it. I expect only a simple program in vpl which can give string input to the 'serialcomservice' block and which i can change in realtime. I tested it by connecting 'data (string)' activity directly to 'received packet' and 'get packet' of the input side of 'serialcomservice' block connected to COM20 port, and listened on other end COM26 using hyperterminal, spTERM. nothing happened. it opened port suceesfully, dssnode ran successfully but no data was transmitted, what should i do? 
    26. února 2012 3:41

Odpovědi

  • After looking at this more in-depth, I believe there might be a confusion in the naming convention used, my apologies.  

    You should utilize the SendPacket command from VPL to Send a Packet Command to the Serial Interface.  You will want to explicitly send a Data 'string' as the Value for the Data.Message Target.  It is probably easiest to utilize the SendPacket and GetPacket interface from VPL.  The ReceivedPacket is a DSS Notification that is a bit more complex to handle in VPL, but is quite useful in DSS via C#.

    13. března 2012 18:26

Všechny reakce

  • We didn't design SerialCOMService to be fully intuitive for VPL.  I'll ask around at the office to see if one of our VPL gurus can work out an example for you.
    29. února 2012 1:30
  • that'll be great but may be i need just a small hint, i'll be grateful for any trivial help too..... thank you for replying   

    dsd

    1. března 2012 13:00
  • After looking at this more in-depth, I believe there might be a confusion in the naming convention used, my apologies.  

    You should utilize the SendPacket command from VPL to Send a Packet Command to the Serial Interface.  You will want to explicitly send a Data 'string' as the Value for the Data.Message Target.  It is probably easiest to utilize the SendPacket and GetPacket interface from VPL.  The ReceivedPacket is a DSS Notification that is a bit more complex to handle in VPL, but is quite useful in DSS via C#.

    13. března 2012 18:26
  • Has anyone gotten this to work?  Following these instructions, I get a NullReferenceException. 

    • Set the initial configuration correctly for my COM port (port 11, 9600 baud, etc. - confirmed this is all correct).  Run VPL project, all services start fine.
    • Sent OpenPort to the service.  This succeeds.
    • Sent SendMessage to the service, with Data.Message set to "asdf".  Then it gives a NullReferenceException.

    Did I miss a step?

    Actually I don't understand how the suggestion could work.  Data.Message is a byte[].

    22. června 2012 19:03
  • I didn't try this one but I got ProMRDS for VPL 2008 to do the same task for me. It has SERIALPORTSERVICE that actually works fine. You can download the code from promrds here http://www.promrds.com/SerialPort.htm. Compile it properly, as directed here http://promrds.codeplex.com/wikipage?title=Installation&referringTitle=Documentation. I have a small VPL program which can communicate through serial port, actually i used it to drive a robo car through AT89C51, so it has some direction dialog interfaces. If you want you can have it. let me know, if you find the way to use this SerialCom service in Vpl4 to do the same task. 

    dsd

    22. června 2012 20:37
  • That got it done, worked on the first try.  Thanks for the quick response.

    23. června 2012 13:56
  • prajwalan, Any way I can get a copy of that? I have been trying unsucessfully for 4 days to get MSRS to communicate with my BS2 BoeBot. Nothing I do seems to work. Thanks.

    Andy North

    18. července 2012 5:40
  • 

    this is the snapshot for the code, use it in vpl 2008 as directed in my last post.

    good luck 


    dsd

    21. července 2012 14:21