Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial

Solved!
Go to solution

I am confused as to how to complete this. What should I put in the false column to make it work?  Or do I even need that false column?

-K
0 Kudos
Message 31 of 43
(1,480 Views)

I'm confused as to what you are attempting to do. You are not sending 0xAA even if you wire up the case statement (it's not a column) and you would simply wire a Boolean to the case statement if you wanted to do a single write or not. Also, you never wire the return count from a VISA Write to the byte count input of a VISA Read. You've completely ignored the previous advice about using the typecast function and you decided, for some reason, to use the Number to Hex String function instead. What exactly in the manual you posted are you attempting to send/receive?

0 Kudos
Message 32 of 43
(1,473 Views)

Yeah I realized that was a dumb thing to do after I posted it.  was about to go in and edit it. I am still trying to send the shutter structur

 

 

struct set shutter
{
BYTE sync_code1;
BYTE sync_code2;
BYTE pack_size ;
BYTE command_code;
short int device_number;
short int shutter_state;
unsigned short int checksum;
};
 
0xAA
0XAA
0X0A
0X94
0X01
0X00
0X01
0X00
0XF4
0X01
This should open the first shutter.
-K
0 Kudos
Message 33 of 43
(1,470 Views)

Place a numeric constant on your block diagram. Right click and select Representation>U8. Right click again and select Display Format>Hexadecimal. Right click again and select Show>Radix. Now drag that into an empty array constant. Enter your values for each element. Wire up a Byte Array to String Function.

0 Kudos
Message 34 of 43
(1,464 Views)
0 Kudos
Message 35 of 43
(1,461 Views)

Overly complicated to use a Build Array instead of an array constant (Array palette) but it's all the same.

 

Since you are sending/reading hex, you do not want the termination character enabled with the VISA Configure Serial Port and I already told you not to wire the output of the VISA Write to the input of the VISA Read. That is just plain wrong!

Message 36 of 43
(1,459 Views)

ok, so we sent it and it did not work. We put a paper clip into port 2 and 3 of the serial cable so it would read us back exactly what we were sending (trick we learned from an engineer who knew labview that was in the building) and we got back

 

\AA\AA\n

 

so only the first 2 parts of the command is being sent. I don't know what to do from here.

-K
0 Kudos
Message 37 of 43
(1,452 Views)
Did you make the change about the termination character? Or did you just ignore what I said? What do you think the VISA read is set to stop on? What did you change the number of bytes to read?
0 Kudos
Message 38 of 43
(1,442 Views)

I did change it, but going back now its turned back on. When ever I turn it off, and then run the program it just switches back on. How do I fix that?

 

We have it to be the numbe of bytes read (should) be equal to number of bytes written.

-K
0 Kudos
Message 39 of 43
(1,434 Views)

*I just went in and deleted the termination character within the serial configuration port. I don't know if this is too extreme, but it still didn't work.

-K
0 Kudos
Message 40 of 43
(1,430 Views)