08-02-2017 09:57 AM - edited 08-02-2017 10:00 AM
Hello, It is now working almost perfectly.
The only thing is that, I must make it work with tcp open inside the loop and in such a way it executes only once (otherwise many connections will be created). This way, the entire VI will be used as an icon with other VIs in a loop.
Kindly assist me!
08-02-2017 10:15 AM
@idir93 wrote:
But I don't want to use any loop. I want this to become a VI where the user will use it inside his while loop.
In that case, make an API. Make one VI that performs the connection and sends the header data then another that just sends your data. Now the user can call the first VI before his loop and the second inside the loop and close the connection whenever they are done.
08-02-2017 10:33 AM
Thanks a lot.
So you mean I will have two VIs?
Please elaborate more, or make an example VI of possible.
Regards,
08-02-2017 11:02 AM
@idir93 wrote:
So you mean I will have two VIs?
That is exactly what I mean. Again, one VI to connect and send the header and another to send your data.
08-02-2017 02:27 PM
I did it with feedback nodes. It works fine. but is it reliable? kindly tell me what's missing for a reliable communication.
Regards,
08-02-2017 03:01 PM
Feedback nodes are a different variation of shift registers that don't require a loop. They may be just fine.
A major problem in your code is the use of the LabVIEW exit function and Stop function. Particularly the Stop, since the code will stop before it ever gets a chance to execute the case structure that closes the TCP/IP connection.
It feels like you are trying to force code in a way that is just not natural. I suggest taking LabVIEW tutorials and browsing the forums more to find examples of code that are better.
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
08-02-2017 03:25 PM
Thank you for your feedback.
Please tell me how i can resolve the stop button issue.
Also, what is unnatural in my code? I did watch video tutorials though.
08-02-2017 08:39 PM
What did you put in those LabVIEW exit and LabVIEW Stop functions? The fact that both are in there are very strange.
I guarantee you don't want either of those in there.
The feedback node on the error wire doesn't seem right. And I'm not sure the feedback wire is quite right on the TCP/IP reference, but I can't tell because you posted an image rather than an actual VI and I can't see what is in the other cases. Beyond that, it is something just doesn't feel right to me about your code.
I think you would be better off if you take the advice that crossrulz gave you about breaking it into two separate subI's rather than forcing it into one.