11/9/2022 0 Comments C string to bcd![]() ![]() Any help or tests would be much appreciated I've been struggling with this for weeks now to no avail.// This is a generated file! Please edit source. My thought is that something in the GPIB Send or VISA Write is taking my string of BCD numbers and sending them out as something else, but I can't figure out what I could be doing wrong. If I send it 17 then 25 it will only take the first one. #C STRING TO BCD SOFTWARE#This routine, and all software in the GCOS-8 C packages, will convert BCD characters to lower. If I put 17 it will go to X1X7.X setting. bcdasc converts a BCD string to the equivalent ASCII string. So, if I send 42 as a floating point, the instrument will go to X4X2.X gauss setting. The interesting thing is that when I send the instrument the information as a %f string, of floating points, so, 7.0000142.00037.00016.000, the instrument registers something happening and the tens and hundreds places change. However, the instrument doesn't register anything happening. I'm sending this to the GPIB Send Message VI in Labview (I've also tried using VISA Write, but it does the exact same thing across all tests as far as I can see). #C STRING TO BCD 32 BIT#VI, I can reproduce the 32 bit BCD string that I expect it should be. ![]() The following bytes, to write 2510.8, should be 0010 0101 0001 0000 1000 followed by 1110 (for the bin 14 control word). #C STRING TO BCD CODE#So, if I'm understanding this correctly in the C code above, the first byte added (aux output port thing) seems to be 7, which should be 0000 0111 in BCD. no change of setting occurs until the control word is received The one bit of the lo byte controls the 10 kGauss overrange when used. The last character sent contains the least significant digit (LSD) of the new Gauss setting in the hi byte location and a load control NON BCD character, (bin 14) in the lo byte which is interpreted to load all registers with the new data. When auxiliary output port is used a fourth byte (any binary number) is added to the beginning of the sequence. Each byte is divided into two half bytes, hi and lo, which may contain BCD numbers only. #C STRING TO BCD MANUAL#I've also attached an image of the pseudo manual that this text comes from.ĭata are transmitted to the FR-41 as a sequence of three 8 bit bytes. This is the text that describes how the instrument receives information (not all of this is useful, but I copy it for the sake of completeness). Because the result to BCD should be 0000 0000 0100, rather than just 0100. Uint8t HourTens (buff0 - '0') //
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |