09-28-2014 11:42 PM
sorry, but why should I write checksum?:womansad:
09-28-2014 11:57 PM
09-28-2014 11:58 PM
@cantata2014 wrote:
sorry, but why should I write checksum?:womansad:
Becaue, As Dennis arealdy said, the protcol requires that.
You have never shown us any of the subVIs, maybe that's what they already do. There is no way for us to troubleshoot any of this unless you show us all code and also show us the requirements of the protocol. I am sure that is available.
So far you have two long threads just pumping hot air. You need to be much more detailed and precise in your questions and we should be able to answer everything within a few posts. Words such as "hex" are very ambiguous. You need to explain in much more details what you mean by it.
09-29-2014 12:26 AM
Hello, this is what all I have done.
I want to sweep the laser frequency. attached is the laser manual.
Sweep frequency:
but it didn't work, so I tried to just select a single channel:
the followings are sub VIs:
SetPower:
Set grid spacing between every two channels:
09-29-2014 12:30 AM
Set grid spacing between every two channels:
select channel:
Enable optical output:
the problem is there is no wavelength output.........I want to sweep the frequency of different channels, but it didn't work, so I try to select a single channel, it didn't work, either.......maybe the initialize is wrong, or maybe the string I write is wrong? I think before sweeping, there should be wavelength output at least....
09-29-2014 12:57 AM
09-29-2014 08:40 PM
I read the manual again and found you are right.............
the manual says the 4 high order bits are redefined by the transport layer (where the packet checksum is added).
the string I wrote before, it is in application layer, right? but the checksum is in transport layer. can I put these two together? I mean the 4 bits in transport layer, and the other 28 in application layer.
if they can be put together, then I can combine them, and send them to VISA WRITE using hexidecimal display?
09-29-2014 10:54 PM
What a poorly written protocol, and a poorly written manual. Their terminology of application and transport layer. They think they are being smart by using these terms from the OSI Model, but they are being used wrongly. So don't try to use their terminology.
Basically, their use of "application layer" is the part of the command that you are trying to do (i.e. command bytes, register bytes, data bytes). While their use of "transport layer" is the part of the command that is directly derived from the other bits and bytes to make sure the data gets through correctly.
Since there protocol only uses 4 bits to define the checksum, and other miscellaneous bits to define status and other things, you are going to need to do some bit manipulation parsing to put the commands together properly. I found on page 7 that it says the checksum is a BIP-4 pattern. I have no idea what it means and would have to do a lot of research on this if I was in your shoes.
You have a very complicated protocol to figure out here. I suggest reading that manual thoroughly several times. Then find a coworker who might know that instrument, but at least knows how to manipulate bits and bytes in programming to help you figure out how to build these commands.
09-30-2014 01:36 AM
I searched for the BIP-4 checksum, it is in a document called OIL ITLA MSA. the manual is intended as a companion to the MSA.
the checksum is a BIP-4, is computed by xor'ing all the bytes in the packet together and then xor'ing the left nibble of the result with the right nibble of the result.
unsigned char calcBIP4( unsigned char* data ) {
int i;
unsigned char bip8=(data[0]& 0x0f) ^ data[1] ^ data[2] ^ data[3];
unsigned char bip4=((bip8 & 0xf0) >>4) ^ (bip8 & 0x0f);
return bip4;
what I don't understand is it says the checksum is defined by transport layer, but how can transport layer 'define' it? can I just calculate it myself and put it in the string?
09-30-2014 07:45 AM
As I said, ignore their terminology of transport layer and application layer. They just don't know what they are talking about.
Yes, you can calculate that checksum yourself. Then you just have to manipulate the results bits with all your other data to combine it into a string to write. It is more than just concatenating string data. It will be actually manipulating the bits within the byte.