ECIOP4016 comms with LabView

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
paulm
Posts: 36
Joined: Mon Mar 28, 2011 9:37 pm

ECIOP4016 comms with LabView

Post by paulm »

Hi,

just wondering if anybody has gotten the ECIOP4016 communicating with LabView through the virtual com port over USB ?

If possible could you share the procedure

Regards,
Paul

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ECIOP4016 comms with LabView

Post by Benj »

Hello Paul,

I've not tried it with the 16-bit ECIO but yes it certainly should work now the USB components are working on this target. To get this working in the past you first have to download and install the Labview VISA runtime to allow the VISA Serial component to work. Once you have done this there should be examples to help get you started. If your stuck then let me know and I will see if I can dig you out an example.

paulm
Posts: 36
Joined: Mon Mar 28, 2011 9:37 pm

Re: ECIOP4016 comms with LabView

Post by paulm »

Hi Ben,

unfortunately when I create the flowcode file it gives errors when compiling.

See attached file. The attached file is very similar to the way I did it in the past when using an earlier version of flowcode.

Can you also explain the procedure for generating the .inf driver files for Labview from within flowcode, assuming I still need to do that.

Regards,
Paul
Attachments
ECIO40P16_USB_Write_PWM.fcfx
(6.55 KiB) Downloaded 277 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ECIOP4016 comms with LabView

Post by Benj »

Hello Paul,

The USB slave component calls a macro when the PC requests a data transfer. You need to create a macro in your program and then put the macro name in the Usb Slave component Slave Macro property. If your macro has parameters then you need to set these using the Macro Parameters property.

Here is the Wiki page for the USB Slave component.

http://www.flowcode.co.uk/wiki/index.php ... 28Comms%29

Setting the Generate Driver property to Yes will generate an inf file in your Flowcode project directory. The Inf file requires a few other fixed files to allow it to work, there are available from the wiki page linked above.

Here is a direct link. http://www.flowcode.co.uk/wiki/images/e/ ... Driver.zip

paulm
Posts: 36
Joined: Mon Mar 28, 2011 9:37 pm

Re: ECIOP4016 comms with LabView

Post by paulm »

Hi Ben,

I have spent a couple of hours trying to get this working and I got to the point where it is recognised as a Slave USB device in the control panel but for some reason Labview is not picking up the device.

I have attached the locally generated inf file. I notice that the VID and PID are not the same numbers as what is in the property window for the USB Slave properties. I had to change the extension to .inf1 to allow it to upload. I have also submitted the flowcode file.

I did also notice that the device I am using originally came up as an ECIO28 in the control panel and not an ECIO40P16 device before I changed the driver to be now recognised as a USBSlave Device.

I have also tried running the installation file of the "USB_Slave_Driver" folder that you pointed me to but it keeps coming up with DPInstxe does not execute on your current operating system.

I'm at at a loss at this stage to try and fix the problem.

Regards,
Paul
Attachments
ECIO40P16_Read_USB_Write_PWM.fcfx
(6.55 KiB) Downloaded 277 times

paulm
Posts: 36
Joined: Mon Mar 28, 2011 9:37 pm

Re: ECIOP4016 comms with LabView

Post by paulm »

I has to rename driver extension to .txt to allow me to upload
Attachments
mm_mchpusb.txt
(3.08 KiB) Downloaded 255 times

paulm
Posts: 36
Joined: Mon Mar 28, 2011 9:37 pm

Re: ECIOP4016 comms with LabView

Post by paulm »

Hi Ben,

I went back to an older device I have (ECIO40P) and I can get this communicating with Labview no problem, where I installed the driver as a Flowcode Slave USB device. I programmed that device from Flowcode 5.

I have followed the same procedure with the ECIO40P16 within Flowcode 6, but I cannot get this communicating with Labview. I have installed the driver without any issues but its not communicating properly.

I cannot really afford to spend anymore time on this, and would be greatful if you could reply?

Has anybody got the ECIO40P16 device communicating with Labview when the device is programmed from Flowcode 6?

Thanks,
Paul

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ECIOP4016 comms with LabView

Post by Benj »

Hi Paul,

I'm just having a go with this using Flowcode as the PC side of things. I am also having problems getting this working so it looks like there might be an issue.

I will investigate and see if I can find the cause.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ECIOP4016 comms with LabView

Post by Benj »

Hi Paul,

Right I think I have found and fixed the problem.

The attached file needs to be placed into this location: "C:\Program Files (x86)\Flowcode 6\CAL\PIC16BIT\USB"
usb_generic_handler.c
(10.31 KiB) Downloaded 255 times
Then simply re-compile and program the ECIO40P16 device and it should now respond correctly to your Labview commands.

Any other problem please let us know.

paulm
Posts: 36
Joined: Mon Mar 28, 2011 9:37 pm

Re: ECIOP4016 comms with LabView

Post by paulm »

Hi Ben,

I followed your suggestion but still cannot get it going.

I notice that the driver I generate from Flowcode 6, will not install from the control panel. I tried to send attached screenshot but it wont let me. Ill email you that directly.

Also, I notice the VID & PID are not the same in the properties window as the inf file which is generated.

Paul

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ECIOP4016 comms with LabView

Post by Benj »

Hi Paul,

Have you recently upgraded to 6.1.1.0 if not then the USB components have been upgraded to allow the ECIO40P16 to function correctly.

I have posted the files here so you can upgrade them manually if upgrading Flowcode is out of the question.
USB_Slave.fcpx
(18.86 KiB) Downloaded 282 times
USB.zip
(215.14 KiB) Downloaded 266 times

paulm
Posts: 36
Joined: Mon Mar 28, 2011 9:37 pm

Re: ECIOP4016 comms with LabView

Post by paulm »

Hi Ben,

yes, I had already upgraded.

Did you get the error I received in relation to the USB driver?

Paul

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ECIOP4016 comms with LabView

Post by Benj »

Hi Paul,

Yes I did get your email and am investigating now, the driver has the PID and VID shown in hexadecimal in the driver .inf file but the values seem to be correct.
Driver.jpg
Driver.jpg (47.4 KiB) Viewed 7651 times
There are additional support files required for the driver to install, these additional files are available from the link below. Simply replace the .inf file with the file generated by your Flowcode project.

http://www.flowcode.co.uk/wiki/images/e/ ... Driver.zip

Post Reply