User Profile
Collapse
-
So I could skip the whole to string and to hex method by just shifting the bits next to each other? So to complete the entire frame 0f 36 bits I could just shift the first parity bit + 8 bit facility code + 16 bit usercode + parity bit and the convert it to a byte array? -
Well I’m using a converter for serial to wiegand. The command u see in the picture is used to send a wiegand frame. A wiegand frame send a id to a other decice. The id is composed from the 16 bits user code portion of the bits. In the picture I believe there sending the id 1943. So I made a program that converts a int to a string of bits and then converts that to a string of hex and then converts it to a byte array that I send. I have been testing...Leave a comment:
-
From binary to hex in wiegand
Hello,
I’m developing an application that needs to send a wiegand signal. I’m using a serial to wiegand converter for that. I’m having a problem though, with sending serial commands.
The documentation specifies how the frame should look. In the frame is a data portion. This contains the wiegand data that is to be converted. In the picture below is the example from the documentation.
The top... -
It finally worked. I found out that my ReadData() method had a check for bytes in the buffer which failed and told me the buffer was empty. If is just start reading I receive a reply.
I thank you very much Jos. I could not have begun to crack this without your help.
BTW. Can I assume that if
Code:(crc>>8)&0xff
Code:(crc<<8)&0xff
Leave a comment:
-
Changed it to :
Code:// crc versturen[7] = CalcCrc(new byte[] {0xE0, 0x12, 0x34, 0x5F, 0xFF}).high; versturen[8] = CalcCrc(new byte[] {0xE0, 0x12, 0x34, 0x5F, 0xFF}).low;
Leave a comment:
-
Thanks for finding that error in my code.
I think there is still something wrong with my calculation. In the example below I’m sending a command that requires 4 bytes of data. The protocol is designed to not give a reply if there is something wrong with the crc.
I confirmed that communicating through code is working when I use the system in monitoring mode. So the cable and the communication setting are correct. It has to...Leave a comment:
-
So I code the initial crc like this :
Code:uint crc = 0x147A; crc = crc << 1; crc ^= 0xFFFF;
Code:uint test = 0xFEDC; // crc test += GetHighLow(test.ToString("X")).high; //crc.high test += 0xA9; // b
Leave a comment:
-
Yes, they are. They are calculated in way I don’t rely understand. It says I have to divide the crc by 0x147A. But is crc the sum of the command and the trailing bytes or zero? I have included a screenshot of the calculation.
I’m not really used to the level of technical programming. I’m more involved in making windows apps and web apps. Though I really like this technical stuff, it’s just hard to understand without the proper...Leave a comment:
-
-
Can someone help me with this serial protocol.
I am making a link between 2 systems. They communicate over a serial link. I know the protocol and all the commands.
However I can’t figure out what the “dn” is supposed to mean. Is it the number of d’s?
I also don’t know what the crc.high and crc.low is all about. I know that the crc is a checksum and I know how to calculate it but I don’t know what the high and low are.
...
No activity results to display
Show More
Leave a comment: