06-27-2014 08:50 AM
iam sorry i am using byte array to string and concatenating it with CR so I am sending string as an input.
06-27-2014 09:10 AM
I am not clear why it is a byte array. All the components of the address are ASCII characters and should not be calculated numeric bytes. But it can be done that way if you are careful.
The VISA read command needs a terminator? You should set the VISA read to terminate on a return character. I would suggest that you use a serial port library such as attached. This is an update to the famous Albert Geven library.
It looks like the command structures haven't changed all that much for MKS. Make sure the address switches are set to 01.
07-02-2014 03:59 AM
This is the attach code that I am using can you please help me out why I am getting timeout error here.
07-02-2014 10:10 AM
First of all, you disconnected the timeout setting so it is a default value and not set. The VI has a lot of crufty code in it. You do not need to explicitly test for the error output since the VISA calls have the standard error handling. You redundantly set the output termination characters. You also hardwired in a byte string as your command, it should be a string variable and I have entered the command as the default string. In general what you had should work, but here is a cleaned up version of that VI.
Secondly, you never answered my comment about why are your sending a value to the close valve command? It is not a command that takes a value. It should not be sent a 1.0000 value. Get rid of that.
Thirdly, you never answered about device addressing. Why are you assuming that the device is at address 0? I believe the factory default is 248 or something like that. If you have the address wrong it will not reply and you will get a timeout.
Lastly. Again I am asking if you are seeing communication activity lights on the device?
07-09-2014 05:18 AM
I cannot open the version that you posted its LV12.0 and I am using LV 11.0, can you change the vi for 11.0, and to answer your question yes I have made mistakes about two things one is about the address I was using rotary switch as an address by setting it manually and the other is I was sending values with wrong command, there is one basic thing that I am confused of as you said that the command should be send as a string, and if command contail numbers how to make it a string command here I have used byte to string which you said is not required what other options I have to send these code as a string.
other problem is while receiving the acknowledgement, I have to read an Carriage return to stop reding for that I am using same property node before reading and setting uo CR to end receiving ack. Is that correct?
thank you for your input....
07-09-2014 08:38 AM
Let me see if I can find what I posted or probably redownload my own code and save if for LV 11.
Second, this is a common misconception. The command is an ASCII string where characters have a numerical 8 bit value. The numbers are sent as a string. So that pi is sent as ascii character for the numeral 3, followed by the ascii character for the decimal point, followed by the ascii character for the numeral 1, etc. This is just an agreement of what 8 bit number will represent what character.
A number is an agreed represenation of a number in binary form. The values for Pi are very different bit patterns for 32 bit floating point and 64 bit floating point. These are 4 and 8 byte groups of data respectively. The order of the bytes can depend on the CPU type. The form of the bits is just an agreed upon IEEE standard (mostly there are some others that are mostly legacy).
LV has a "format into string" and a "scan from string" functions in the string palette to convert from ascii strings into numeral types and back.
07-09-2014 09:03 AM
@pari89 wrote:
I cannot open the version that you posted its LV12.0 and I am using LV 11.0, can you change the vi for 11.0,
other problem is while receiving the acknowledgement, I have to read an Carriage return to stop reding for that I am using same property node before reading and setting uo CR to end receiving ack. Is that correct?
I think you have the settings correct. They are all set at the beginning of the operation and don't need to be set between the write and the read. You have set the read to be terminated by the CR character.
If you set the thumb wheels to be the address you need to set the address from the front panel to something weird (248??) to use the thumb wheels. Read the manual carefully about addressing.
07-18-2014 03:15 PM
2 ports on the MF1 - want to be sure using the correct one.
from pg 74 in manual for commands. Example: send @01F[cr] gives @-CFdddddddd[cr] in sccm.
>note set baud = 115200 8bit no parity, 1 stop, no handshake
j