Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Mosaic QCard Controller

I am currently trying to gain access to the Mosaic QCard Mini-controller through a serial (RS232) connection via LabVIEW. The instrument has pre-packed programs in C and it's own IDE and compiler equipt with the system. The problem I am having is once I gain access to the instrument through the serial port, how do I load and execute the programs already placed onto the controller's EPROM memory? I have writen several programs controlling various functions of the QCard, but I can not get them to automate through LabVIEW. I tried using an Automation Refnum to the Mosaic IDE, but there is no available DLL that comes pre-packaged with the software.

I have included the link to the "QCard Bible" so you can get some background on this device. According to Mosaic, LabVIEW has been used for this application before, but due to company policy, this information could not be given to me. I was hoping to not have continue to bark up that tree, but if I need to, I will. I have a two month turnover on this device, and I am running out of ideas. Can you help me? Thank you.

http://mosaic-industries.com/Manuals/pdf/C_Programmers_Guide_to_QCard.pdf

-PB
0 Kudos
Message 1 of 9
(4,627 Views)
Hi

From what I read on serial communications (page 122 and further) you can directly communicate with the QED-Forth environment.
Some exmples are given.
Maybe that is the way to go..
greetings from the Netherlands
0 Kudos
Message 2 of 9
(4,622 Views)
I have reviewed the manual on several occations, and I have not been able to make sense of the LabVIEW side.  I can communicate setting information to the QCard using Serial Port Configure.  That I understand.  However, when it comes to sending specific commands, I am unclear.  I have attached the program I put together as a rough first shot at it.
0 Kudos
Message 3 of 9
(4,615 Views)
The access mode constant and the Allow Transmit property are not necessary. Have you tried using Hyperterminal to communicate and run the examples mentioned? Try that before playing around with LabVIEW code. Once you have something working in Hyperterminal, you just have to use send those commands with the VISA Write. It appears that the device requires you to append at least a carriage return after each command. You have to explicity provide for this in the LabVIEW code you write. If you were look at the shipping examples for serial communication, you would see two of the methods for doing this. The basic example has the string control set '\' Code Display. The \r\n that you see are the \ codes for a CR and LF. The advanced examples uses a property node to set the termination character. You can also use the concantanate string function and use the constants on the string palette.
0 Kudos
Message 4 of 9
(4,612 Views)
I have been able to send and receive the packaged programs with HyperTerminal as well as the pre-packed Mosaic Terminal program, which is very similar to HyperTerminal.  So, once I have something loaded onto the QCard using Hyperterminal I can start sending the commands I need each program to run?

What if I have multiple programs that need to be loaded at different times and I need that process to automated?  Can LV do that?  If that's not possible, then I will have to come up with a different solution.
0 Kudos
Message 5 of 9
(4,608 Views)

If you can send and receive programs with Hyperterminal, you can send and receive programs with LabVIEW. You can then send commands with LabVIEW as well. In order to send a file, you can use the VISA Write From File or load the file with one of the file I/O functions and use the VISA Write to send the data.

You can automate anything you want. There are numerous functions on the timing palette. You can use them to take an action based on the date/time or on how much time has elapsed.

Open the example finder and do a search for serial. These will give you a starting point. When you write your application, you will want it to execute the VISA Configure Serial Port only once when the program first starts and you want to execute the VISA close only once when the program finishes. There are other things you may need to change. For example, instead of requesting some fixed byte count with a constant, you may have to use the VISA Bytes at Serial Port to determine exactly how many bytes are in the serial port buffer.

0 Kudos
Message 6 of 9
(4,606 Views)
Hi

Looking at your program showed me that you are ending a read on \n but a serious problem in LabVIEW is that knowbody sees that you have to send a CrLf
or Lf with the command. The configure serial port simply does not support this.
So add a CrLf to your string and it should work.

Another problem is the Open Serial Port VI should be placed before the Serial Config VI.
Especially the Load Configured Settings is wrong because that means Load this from the settings defined in the Measurement and Automation Eploder.
Not from the setiings that you just configured.

By the way, you learned me a new property: about Xon/Xoff communication.
thanks for that.

greetings from the Netherlands
0 Kudos
Message 7 of 9
(4,587 Views)
I am now able to send commands to the QCard when I compiled and ran the Mosaic Pre=packed Examples in C. I have wired in the write buffers with appropriate line feed and carriage return characters. However, when I wire in the VISA Read function, I am only getting back part of the answer. The whole message is not coming through. I then added a Wait Function (similar to Basic Serial Read and Write.vi), but I still am not getting the full answer back. Could it be that I'm not waiting long enough? What do you think it could be? I've double checked my factory settings so the Serial Port is configured correctly. I know I am missing something.
0 Kudos
Message 8 of 9
(4,578 Views)
You need to be aware how the VISA Configure Serial Port and the VISA Read work. Besides setting baud rate, etc., The VISA Configure Serial Port includes an input called Enable Termination Character. When this is true or left unwired, the VISA Read will stop reading whenever the character (as defined by the VISA Configure Serial Port), is detected. This is usually a good thing but can cause problems with multi-line responses. The default termination character is a LF (x0A). If the instrument is returning multiple lines that are terminated with a LF, then that would account for your partial read. You would need to wire a false constant to the input of the VISA Configure Serial Port and use the VISA Bytes at Serial Port to determine exactly how many bytes to read.
0 Kudos
Message 9 of 9
(4,572 Views)