Discussion:
Virtual COM port (FTDI chip set) - PC lock up using LV & Visa
(too old to reply)
Chris Harden
2008-07-24 08:10:06 UTC
Permalink
The FTDI virtual com port chips (such as the FT2232C device) are industry standard USB com port chips, and yet communication with them via LabView/Visa appears to result in occasional lock up of the PC.  CTRL/ALT/DEL does not work, you have to reboot the PC to get out of it.  What is the problem and why cannot the Visa library accomodate this industry standard chip? What is the work around (apart from buying NI hardware - not an option in this case).
JoeLabView
2008-07-24 13:40:09 UTC
Permalink
The reason for the lockup is due to your code.&nbsp; You have not fully grasped the use of an Event Structure.&nbsp; To learn more about LabVIEW, I suggest you try looking at some of <a href="http://wiki.lavag.org/LabVIEW_tutorial#External_Links" target="_blank"> these tutorials</a>.
There are ways of having a single loop that contains the Event Structure, but that would require a very lenghty discussion.&nbsp; You should change your architecture to a Producer Consumer loops where the Event Structure is your Producer loop and feeds a state machine which is your consumer / communication loop.&nbsp; The basic reason for that is that you have nested loops within an Event Case.&nbsp; That's a big "no... no"..&nbsp; Because as you try &amp; try to stop the operation, unless all the triggers align, it will start a new iteration and reset the triggers, over &amp; over again, which will lock up your PC.&nbsp; I do realize that you are ORing all those booleans..&nbsp; But your Event Case wants to process the stop event which will start the whole process again...&nbsp; You could try removing it from your event case..
Also,&nbsp;you do not need a Case Statement wrapping your code.&nbsp;
R
JoeLabView
2008-07-24 14:10:06 UTC
Permalink
Can you post your code?
&nbsp;
R Message Edited by JoeLabView on 07-24-2008 09:43 AM
Dennis Knutson
2008-07-24 14:10:09 UTC
Permalink
I've used a couple types of USB-RS232 adapters (single and multi-port) and had the FTDI chip set on some in-house designs and have not had any lock-up problems. What OS and version of NI-VISA are you using? do you see the same problem on a different pc?
Chris Harden
2008-07-24 14:40:06 UTC
Permalink
Hi Dennis,
This is running on a WinXP PC, LV7.1 and Visa 4.3.&nbsp; I have seen other postings which indicate there could be a Visa related problem with what NI claim are 'non standard' implementations of the virtual comms port protocol.&nbsp; I haven't yet rried it on my Vista laptop, but may do so over the weekend.
&nbsp;
BENIO
2008-08-08 16:10:06 UTC
Permalink
Guys,
this topic might be interesting for me since I have to write SW for my appliaction using the FT2232C USB to I2C.
Is there anybody having some example code to drive I2c protocol?
&nbsp;
Regards,
JoeLabView
2008-08-09 11:10:05 UTC
Permalink
I2C is a bit different than your COM port communication.
It uses&nbsp;a clock and data line.&nbsp; The clock frequency has to be within the spec of the particular device / mfg.&nbsp; You will find the&nbsp;protocol on the data sheet for the device, which means any headers, memory locations, registers, etc depending on the type of device.&nbsp; There are many devices, such as temperature sensors, SEEPROM, etc.&nbsp; From the hardware side, you may also need to set the&nbsp;ID of the device, which is usually 3 pins that you tie to Vcc or Gnd.&nbsp; If it is a memory device, you may need to index which block you are writing to.&nbsp;
I've only written firmware for I2C devices using VxWorks.&nbsp; The clock was provided by the card.&nbsp; The FPGA also provided the interface for the data, so the SW just wrote to it.
Now, to describe how to do this using LabVIEW would require that you provide more details about the interface.&nbsp; Does your USB to I2C provide the clock for you? it probably does.&nbsp; If it is a product that you purchased, it must come with an API or some explanation on how to communicate with the I2C device.&nbsp; What does it say that you need to do in order to communicate with it?&nbsp; Once you tell us this, we might be able to suggest how to proceed with LabVIEW.
R

Loading...