Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Connect hamamatsu c9525 to labview via USB port/communication error

because it was not clear to me what it was that I had to do.

How would I create a CR constant? 

0 Kudos
Message 51 of 62
(1,322 Views)

I already went to Visa Read/ byte count input/, changed Display format to hexa and wrote D in the constant box which is CR in Char.

but it still sees it as 13 numeric

what should I write in the byte count in order for Visa read to understand it should stop at CR?

something else:

hammamatsu receives instructions ending in CR 

but does not send back 0D (cr), it only sends data without a termination character;

Request: 28.10.2014 17:24:35.22764 (+724.1494 seconds)

46 0D F.

 

Answer: 28.10.2014 17:24:35.32464 (+0.0970 seconds)

56 65 72 31 2E 36 30 20 43 39 35 32 35 2D 30 33 Ver1.60 C9525-03 FA0015

46 41 30 30 31 35 20 20 

Port closed

 Request ended in 0D

Answer ended in 20 which is space

Request: 28.10.2014 17:11:57.19864

52 0D R.

Answer: 28.10.2014 17:11:57.36664 (+0.1680 seconds)

00 00 0A 00 01 00 05 01 01 00 00 00 2D

answer ended in 2D which is - minus 

 

So, if the read is waiting for CR it is not going to receive it.

How do you see this situation?

 

0 Kudos
Message 52 of 62
(1,308 Views)

How do I make a button that, when pressed in the front panel, sends 460D toVisaWrite write buffer and 24 to the Visa REAd Byte count ?

0 Kudos
Message 53 of 62
(1,305 Views)
First thing to do is on the VISA Configure Serial Port, right click on the termination character terminal and select Create Constant.

For your main, use an Event Structure. For a value change event of the button, place your VISA code.
0 Kudos
Message 54 of 62
(1,301 Views)

I had already done that the instant you told me not to mess with Visa Serial and only work in the main block diagram.

Visa Serial has a constant set to True at its Enable Term.Char. input.

 

And thank you for telling me about "event structure" too, I am working on it right now.

0 Kudos
Message 55 of 62
(1,289 Views)

What function transforms the boolean 1 ,resulted from pressing the "Read value" trigger button in the front panel,

to decimal value 24 

which I need to connect to Visa Read Byte count?

I need something that is triggered when receiving boolean 1 and Outputs the decimal 24.

Where do I find that object?

 

0 Kudos
Message 56 of 62
(1,284 Views)

The above question still stands;

meanwhile I solved the 24 decimal input to visa read byte count by placing a constant ~24~ inside the event structure, tying it to the border and tying the border to the visa read byte count.

My first attempt had been unsuccessful because I simply dragged the constant into the event trigger rectangle and it did not work.

Now it does.

But still:

what object is triggered when receiving boolean 1 and Outputs the decimal 24.

0 Kudos
Message 57 of 62
(1,279 Views)
I don't understand what you have done. Please attach an image of the block diagram.
0 Kudos
Message 58 of 62
(1,273 Views)

The first event in the Event struct. is read info which has the command in the box and returns 24Bytes

the second is Quit/turn off remote which has the command in its box and receives 2 Bytes.

 

As shown in the picture, they work perfectly.

Now

I need to insert into another event command box a dynamic command such as the voltage regulation:

for that I created this prototype (in picture 2) which takes decimal values coming from the Numeric Control, 

didides to 100, splits the quotient and the remainder, transforms them to hexa,concatenates them and adds V in front of the string and CR behind(this is the syntax Hamamatsu understand V value1x100+value 2).

 

I need to insert this command into an event.

To make it simpler: adjust the value from the knob, then click SET button and only then the value is sent to the event, thus making it simpler.

 

How do I insert the voltage command into an event structure?

 

Download All
0 Kudos
Message 59 of 62
(1,269 Views)
I'm sorry but none of that code is even close to correct. You still have not defined the termination character and the event cases are completely wrong. You need a while loop around the event structure. In the read event, the Boolean needs to be inside the event and you need the VISA Write and Read in there as well. The only code that belongs outside the loop is the configure and close functions.

These mistakes can be solved by taking the numerous free tutorials and by looking at the shipping examples.
0 Kudos
Message 60 of 62
(1,265 Views)