From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-01-2020 05:51 AM
10-01-2020 10:07 AM - edited 10-01-2020 10:09 AM
Hi milan,
@milan87 wrote:
This hardware uses FTDI chip, FT232.…Can someone advise why is this happening, and how to overcome problem?
Does that FT232 device support a "standard" VCP (virtual COM port) instead of accessing it using that DLL? Then you coul dhvae used the VISA functions coming with LabVIEW!
The problem is the typical "Don't use BytesAtPort!" error as has been described in this forum on nearly every thread about serial communication!
You are basically doing the same: reading FTDI queue status to get the number of bytes waiting in the buffer queue, combined with an arbitrary wait function. Don't do that: read the number of bytes as is expected in the message!
From what I see in your images I would use this approach:
This procedure doesn't need any wait function…
On your VIs: you really should rework those FTDI functions to use error IO. This will allow to get rid of all those sequence frames as error wires allow very easy "THINK DATAFLOW!" programming!
10-02-2020 02:39 AM
Hello GerdW,
first of all, thanks you on your help.
If I set the VI to read 3 bytes, instead of reading all bytes in buffer, then VI immediately collapse every time...
Only when I use ''Get number of bytes'', VI doesn't collapse.
What do you think?
It has virtual com port, but for now I need to complete vi with dll.
10-02-2020 03:06 AM
10-02-2020 03:15 AM
Hi Gerd,
VI immediately stop responding and close. No error window.
I will check with visa.
10-02-2020 06:44 AM
Hello,
I created VI which use visa.
Sending CAN frame is ok, everything normal, same as with ft2xx dll.
When try to read only 3 bytes and then the rest, communication doesn't work, and VI give a error. In att.
But when I read all bytes in buffer, I can read data but mixed up, same as with dll.
Any advice?
Thanks a lot.
10-02-2020 07:09 AM
Hi milan,
again you are using BytesAtPort even though I wrote you should not use it…
The VISA reference might get closed in your state machine before you try to read/write using it.
Using "default if unwired" tunnels with references is a NO-GO! Use a shift register and wire all tunnels in all cases instead!
Your array constants contain more data than is visible: is this intended? For documentation issues you should always show ALL data that is contained in those arrays…
10-02-2020 07:25 AM
hi Gerd,
I use BytesAtPort because that's the only way I get some results.
As far I write some constant number of bytes to read, I get not responding VI.
Shift registers are added.
Constant arrays are ok, I have proper sending, and feedback from CAN node, only reading in VI are mixed.
I checked with oscilloscope.
What is wrong here?
Thanks.
10-02-2020 12:09 PM
Hi milan,
simplified your VI, see attachment…
@milan87 wrote:
I use BytesAtPort because that's the only way I get some results.
As far I write some constant number of bytes to read, I get not responding VI.
This sounds weird!
Right now you just wire the BytesAtPort node, but don't use its output. And without that node your VI does not work anymore?
@milan87 wrote:
Constant arrays are ok, I have proper sending, and feedback from CAN node, only reading in VI are mixed.
I checked with oscilloscope.
So now you are saying the VI is working? Is it?
Can you show some resulting data from your VI?
10-05-2020 07:45 AM
It isn't connected, because you advised not to use it. However, as I said, it work only when I connect this to read block, to readout all bytes in buffer.
If I use some other value then this, then VI stop and collapse.
I find what was the problem. This is not mixed frames, this is couple of frames merged in buffer.
So I filter them, using DLC byte (as you suggested), and some other filtering.
So now I got couple of frames in one reading.
Thank you on your help.