LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent!!! Need help in file read/write data to a serial port

Hi,

 

I really need someone's help in order for me to complete my project. I have attached a vi which I have taken from an example and integrate to my project. In the vi, I have managed to get the encoder counts using Ni 9411. I need to read/write that data from ni9411 to ni9870 without using any serial port as they are connected to a NI 9104 chasis. May I know whether I am correct in writing the data to my ni9870 port using the vi I have attached? Does anyone know how i can convert the number of counts to a 8-bit data/byte so that I can send the data through the RS232 port? I really need someone's help as I need to finished in 2 weeks time.

 

I have also attached an vi on controlling the epos2 controller using instrument driver. Does anyone know how can i integrate this vi to the fpga vi (the one which I need to read/write data to 9870) as I need to send those data to control my epos2 controller.

 

Please help me!!!

Download All
0 Kudos
Message 1 of 6
(3,388 Views)

Afai,

 

As I allready suggested you here, call your local NI Office and ask for assistance!

You really need assistence in a higher level that we can provide via the forums. Otherwise I don't see a chance for you to finish your project in time.

 

1. Convert I32 to U8 to write it to the 9870 could be done like this:

 

I32toU8.jpg

 

 

2. The vi to control the epos2.

 

There is NO way ( absolutely NO way) to port this vi to FPGA. It's based on VISA calls, uses an event-structure, both are not available at the FPGA.

The only thing you could do is to analyze the VI, the instruction set and design an FPGA vi which handles the specific instructions you would need.

I have no experience with epos2 and I'm not 100% sure if this would work as you would like to use it. And doing this needs deep knowledge of LabVIEW, VISA, Instrument Drivers, the epos hardware, FPGA programming, and so on... 

 

 

Christian

 

 

 

Message 2 of 6
(3,360 Views)

HI Christian,

 

So sorry to bother you. I have tried to call the national instrument office and even went there but the engineer is not so sure on doing this.

Thank you for helping me converting the data to 8-bits. So is that the way to write the data using rs232 port?  Thanks anyway... Really appreciate your help...

0 Kudos
Message 3 of 6
(3,340 Views)

Hi,

 

Well, the RS-232 works with ASCII Characters, so one character is one byte. Because of that the read/write nodes of the 9870 are using U8 as Datatype. Since your counter value is stored as an I32 you will need to split it up into it's bytes and send them. But keep in mind that at the other side, so the receiver side, you have to reinterpret four ASCII Characters to become a I32 representing the counter value.

 

Where are you located and at which NI Office have you been?

 

 

Christian

0 Kudos
Message 4 of 6
(3,299 Views)

Hi Christian,

 

Ouh, thank you so much for explaining the data types of the NI9870. Using the example that you have given me on the previous post, will I still be able to send te data even if my counts is negative(example, -300)? Thanks. Mine is located at Singapore. Actually, the engineer is quite good and friendly in explaining on the communication part. It's just that we are so new to the Labview and I've only left with roughly 2 wks to finish the project. We only started learning Labview about 5wks earlier. That's y we are so noob at programming.

0 Kudos
Message 5 of 6
(3,284 Views)

 

Hi everyone,

 

Has anybody program a epos2 controller before? Need to ask questions regarding this. Thanks

0 Kudos
Message 6 of 6
(3,250 Views)