LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Editing LIFA for custom function

I would like to try to use an inkshield with LIFA so I can drive an inkjet printhead with labview.

DSCN7348

According the theory page of the inkshield the timing is very important to drive the jets correctly.

I would like to make a new subvi that tells the arduino to execute these lines of code:

PORTB = PORTB & 01111111;
delayMicroseconds(5);
PORTB |= 10000000;
delayMicroseconds(800);

This will be my biggest project so far so any suggestions would be very helpful.

Download All
0 Kudos
Message 1 of 8
(6,168 Views)

Do you have this code working in an Arduino sketch already?

Making custom functions for LIFA is quite simple.  Start with duplicating an existing function from LIFA and make sure that you have this custom one working (new code on both the Arduino and in LabVIEW).  Then, start customizing by adding your custom code to the newly created LIFA function.

0 Kudos
Message 2 of 8
(4,269 Views)

You were right! That was incredibly easy. I just copied a few lines of code from the inkshield example sketch into lifa_base.ino and renamed it lifa_ink.ino. I then edited some of the lifa examples. If anyone is interested you can see the attached code. My example indexes a stepper motor and then fires any or all of the 12 inkjets availabe.

arduino

pin        fuction

2          InkShield pulse

6          stepper pulse

7          stepper dir

a0        InkShield A

a1        InkShield B

a2        InkShield C

a3        InkShield D

0 Kudos
Message 3 of 8
(4,269 Views)

hey Hyrum !!!

Could please guide me step by step on how you add your own custom function on lifa. in trying to add a custom function to complete the running averrage attached below. please Man help!!!

Kindest Regards

Ian

0 Kudos
Message 4 of 8
(4,269 Views)

HI there,

i have tried to add my custom code into LIFA and then I ended up with some issues which I have no clue about.

the attachments are as:

1-labview interface library for arduino (LIFA-BASE)

2- I2CDEVLIB library, YOU CAN FIND THE .INO FILE by extracting the rar file and then navigate to mpu6050>examples>MPU6050_DMP6>MPU6050_DMP6.ino

3- my custom library added into LIFA-BASE library , it has some minor error but i dont have any idea what can be the problem.

I apprecate if somebody ca figure out the problem it might be so simple but I'm stuck at this moment with no idea.

Download All
0 Kudos
Message 5 of 8
(4,269 Views)

If you provide your archives in more widely accepted format (e.g. a zip file) you might have better luck at people viewing your files.

0 Kudos
Message 6 of 8
(4,269 Views)

People asking for help with LIFA,

 

I haven't worked on this in nearly two years and spent very little time with LIFA. I have moved on to the new LINX interface but have still only spent a little time with it.

I would recommend you try your best to do all your custom programming in labview and leave the Arduino firmware alone. Of course, if you do this you might as well move onto LINX which installs the correct firmware for you.

Ian,

This Arduino code can easily be done in labview. Just use LINX analog read and average the samples together in labview.

Ferizitko

There is not enough information in your post to help you even if I could. What ver of Arduino are you on?  What are you trying to do? What lines in the Arduino firmware have you changed?

Thanks

Hyrum

0 Kudos
Message 7 of 8
(4,269 Views)

Hi there,

I'm adding special functions to LIFA. Although I would not need the whol source code of the LIFA so I put everything needed in my separate sketch. I uploaded it to the Arduino. The uploading went well. But I have a strange problem. During the debugging process I can see that I receive every byte well from the Labview but the checksum does not matcz for some reason. If I delete lines of code randomly in the loop sometimes the checksum works fine.

Could anyone help me what can be the problem?

Thanks in advance.

Manuel

0 Kudos
Message 8 of 8
(4,269 Views)