LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

laser scan frequency doesn't work

sorry, but why should I write checksum?:womansad:

0 Kudos
Message 11 of 25
(2,509 Views)
Because your programming manual says it's required.
Message 12 of 25
(2,499 Views)

@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.

Message 13 of 25
(2,495 Views)

Hello, this is what all I have done.

I want to sweep the laser frequency. attached is the laser manual.

 

Sweep frequency: 

configure_3.png

 

 

but it didn't work, so I tried to just select a single channel:

configure_4.png

 

the followings are sub VIs:

SetPower:

SetPower.png

 

 

Set grid spacing between every two channels:

 

 

 

 

 

 

 

 

0 Kudos
Message 14 of 25
(2,478 Views)

Set grid spacing between every two channels:

SetGrid.png

 

select channel:

SetChannel.png

 

Enable optical output:
SetResena.png

 

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....

0 Kudos
Message 15 of 25
(2,471 Views)
Your string is wrong and I've said that several times. You are not following the protocol in the manual. Read it. Nothing will happen until you send the correct command.
0 Kudos
Message 16 of 25
(2,464 Views)

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?

0 Kudos
Message 17 of 25
(2,429 Views)

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.

0 Kudos
Message 18 of 25
(2,421 Views)

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?

0 Kudos
Message 19 of 25
(2,408 Views)

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.

Message 20 of 25
(2,398 Views)