Search Results

Search found 10 results on 1 pages for 'rross'.

Page 1/1 | 1 

  • Binary to Ascii and back again

    - by rross
    I'm trying to interface with a hardware device via the serial port. When I use software like Portmon to see the messages they look like this: 42 21 21 21 21 41 45 21 26 21 29 21 26 59 5F 41 30 21 2B 21 27 42 21 21 21 21 41 47 21 27 21 28 21 27 59 5D 41 32 21 2A 21 28 When I run them thru a hex to ascii converter the commands don't make sense. Are these messages in fact something different than hex? My hope was to see the messages the device is passing and emulate them using c#. What can I do to find out exactly what the messages are?

    Read the article

  • Monitor a COM port already in use.

    - by rross
    Is it possible to read from a COM port already in use on Windows XP? I would like to see the communication between some software and a device plugged into a serial device. I wrote a small program using C# to monitor the COM, but once it's in use by the other device it will not let you open it again. How can one monitor a COM port already in use? I'm open to 3rd party software. Thanks

    Read the article

  • Trouble parsing NMEA data from Serial Port.

    - by rross
    I'm retrieving NMEA sentences from a serial GPS. Then string are coming across like I would expect. The problem is that when parsing a sentence like this: $GPRMC,040302.663,A,3939.7,N,10506.6,W,0.27,358.86,200804,,*1A I use a simple bit of code to make sure I have the right sentect: string[] Words = sBuffer.Split(','); foreach (string item in Words) { if (item == "$GPRMC") { return "Correct Sentence"; } else { return "Incorrect Sentence } } I added the return in that location for the example. I have printed the split results to a text box and have seen that $GPRMC is indeed coming across in the item variable at some point. If the string is coming across why won't the if statement catch? Is is the $? How can I trouble shoot this?

    Read the article

  • Reading Binary data from a Serial Port.

    - by rross
    I previously have been reading NMEA data from a GPS via a serial port using C#. Now I'm doing something similar, but instead of GPS from a serial. I'm attempting to read a KISS Statement from a TNC. I'm using this event handler. comport.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived); Here is port_DataReceived. private void port_DataReceived(object sender, SerialDataReceivedEventArgs e) { string data = comport.ReadExisting(); sBuffer = data; try { this.Invoke(new EventHandler(delegate { ProcessBuffer(sBuffer); })); } catch { } } The problem I'm having is that the method is being called several times per statement. So the ProcessBuffer method is being called with only a partial statment. How can I read the whole statement?

    Read the article

  • Logictech USB HID controller message

    - by rross
    I have a Logitech game controller(http://www.amazon.com/Logitech-Dual-Action-Game-Pad/dp/B0000ALFCI). I'm using c# and Microsoft's HID driver to track what buttons are being pressed. Each button press sends a Byte Array that has 8 values. The problems is that I don't know what those 8 value represent. Here is an example: 0, 128, 126, 127, 130, 24, 24, 0, 4, 252 0, 128, 126, 127, 130, 40, 40, 0, 4, 252 0, 128, 126, 127, 127, 72, 72, 0, 4, 252 0, 128, 126, 127, 127, 136, 136, 0, 4, 252 Those are the values of the Byte Array for button press 1, 2, 3, 4 respectively. I see where the values are changing, but I'm unsure what they represent. I'm unable to find any specs on Microsoft HID driver. Can someone point me in the right direction?

    Read the article

  • Trying to figure out how to check a checksum

    - by rross
    I'm trying to figure out how to check a checksum. My message looks like this: 38 0A 01 12 78 96 FE 00 F0 FB D0 FE F6 F6 being the checksum. I convert the preceding 12 sets in to binary and then add them together. Then attempt a bitwise operation to apply the 2s complement. I get a value of -1562, but I can't convert it back to hex to check if the value is correct. Can someone point me in the right direction? my code: string[] hexValue = {"38", "0A", "01", "12", "78", "96", "FE", "00", "F0", "FB", "D0", "FE"}; int totalValue = 0; foreach(string item in hexValue) { totalValue += Int32.Parse(item, NumberStyles.HexNumber); } int bAfter2sC = ~totalValue + 1; Console.Write("answer :" + bAfter2sC + "\n");

    Read the article

  • Using USB PS2 hand controller in C#.NET

    - by rross
    I'm attempting to create a program that takes input from a usb ps2 hand controller, translate and passes the info to a rs232 device. I already have everything working for the rs232 device. The problem is interfacing with a usb controller. There doesn't seem to be any good documentation out there and on top of that .NET3.0/3.5 doesn't have any libs to help you out. How would one even get started?

    Read the article

  • How to apply encoding when reading from a serial port

    - by rross
    I'm reading data from a serial port. I read this posting: http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/a709d698-5099-4e37-9e10-f66ff22cdd1e He is writing about many of the issues I have encounter, but in his writing he refers to using: System.Text.Encoding.GetEncoding("Windows-1252"). The problem I'm having is when and how to apply this. There are three potitional spots in my opinion. When the serial port object is define: private SerialPort comport = new SerialPort(); The Event handler: comport.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived); Or when reading the data: string data = comport.ReadExisting(); No matter where I add it. I seem to get errors. How would one use Encoding?

    Read the article

  • Adding Values to a Byte Array

    - by rross
    I'm starting with the two values below: finalString = "38,05,e1,5f,aa,5f,aa,d0"; string[] holder = finalString.Split(','); I'm looping thru holder like so: foreach (string item in holder) { //concatenate 0x and add the value to a byte array } On each iteration I would like to concatenate a 0x to make it a hex value and add it to a byte array. This is what I want the byte array to be like when I finish the loop: byte[] c = new byte[]{0x38,0x05,0xe1,0x5f,0xaa,0x5f,0xaa,0xd0}; So far all my attempts have not been successful. Can someone point me in the right direction?

    Read the article

1