LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Format issue

Initially I was using VISA for communicating with arduino, now I switched to LINX, I have set of strings which I need to write and read back, but in LINX pallete when I saw I have only option to read and write in numeric array.

All I want is option which will write and read to arduino in string format. This is the string which I need to write

1. @*B$*IL$#

2. @*DK1$*LK$*DK0$#

3. @*AB$*AC$*AA$*AD$#

4. *AH$

Do I need to use string to byte array for the same. Above is my string which I need to write to arduino.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 1 of 18
(6,489 Views)

LINX is not an alternative to VISA.  LINX is the the continuation of LIFA (the basic architectures are the same).  VISA is a general serial communication software and both LIFA and LINX use VISA to communicate with Arduino.

So, if you are not using the firmware provided by LINX or LIFA, you simply need to use VISA alone.

If you believe that I misunderstood your post, please let me know.

0 Kudos
Message 2 of 18
(4,001 Views)

I am not using it instead of VISA. Intially I was using VISA for communication with arduino. Using this I was facing some issues so I thought why not use LINX for crosscheck. I wrote my own firmware in arrduino in which I send some command using VISA and read it back(Working fine with serial monitor).

Now here I was using VISA and also I need to write / read string only. But in case of LINX I dont have string provision.

I only want to use LINX instead of VISA(Doesnt matter whether LINX using VISA or not).

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 3 of 18
(4,001 Views)

What are you actually trying to do?  What are you doing with the strings?

0 Kudos
Message 4 of 18
(4,001 Views)

My string instructs arduino to perform some job, it may be analog operation, digital operation or do some acknowledge operation etc.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 5 of 18
(4,001 Views)

I assumed that much.  There isn't really a need to ever send an encoded string when using LINX.  You should simply send the relevant parameters that your operation needs via your custom function (the parameters will need to be converted to the U8 data type in LabVIEW and then rebuilt, if necessary in Arduino).  A custom function in LINX (or LIFA) requires adding code to the firmware as well as creating subVIs to interact with that function.

For more inquiries regarding LINX, please post on the LINX forums because the people that use LINX regularly, that can help, do not generally browse the LIFA community discussions.  When you do post over there,  I find it best if, in addition to the specific question, you provide the overall goal of what you are trying to do.

0 Kudos
Message 6 of 18
(4,001 Views)

I have a hardware in which other components like R,C, relay and other things are connected. In that arduino plays a heart. It turns relay ON/OFF and becasue of that analog value, digital values changes accordingly.

In my string I send one command in which it will turn ON/OFF realy and other component and do the other job and reply with final result. in one command I do atmost 5 operation. If for each operation I send one command then it will take minutes for completion of one testing. Looks like not good for me

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 7 of 18
(4,001 Views)

I don't think you understand what I'm saying.  If you could explain what exactly your function is doing (each of your sub-functionalities) then I might be able to write a VI that would better help you understand what I'm saying.  If you could post your Arduino code, that would make it even easier.  Lastly, if you could explain your strings that you are wanting to send (explain each of the significant characters and components) that would help also.

0 Kudos
Message 8 of 18
(4,001 Views)

For example

@*AB$*AC$*AA$*AD$#

This will read the analog value of A0,A1,A2 and A3 and send it back. I cant post my arduino code because its official.

Just tell me if I am using MEGA 2560 and LV2011 then in WIN XP SP3 it is failing after few communication but same code is working fine at WIN7. What could be the issue. Next time I need to reconnect the arduino to make it work.

In my testing I send 30-40 command to arduino. Sometime in SP3 for 2-3 testing works fine but after sometime it fails

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 9 of 18
(4,001 Views)

http://forums.ni.com/t5/LabVIEW/2-COM-port-swithching-at-once/td-p/2934152

Here is my question but in this actual problem is arduino fails inbetween communication. Its not at all related with two COM port(I found out this issue later).

Here is my VI. Let me know if you find any bug there

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 10 of 18
(4,001 Views)