LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial port communication IRP_MJ_READ

Solved!
Go to solution

Hello, i would like to ask you about serial port communication. I am currently trying to make application for communication with my stepper motor (Microcon), but it doesnt work. If i try to communicate with original software, my serial port monitor gives me values 

 

IRP_MJ_WRITE  when i write some values and

IRP_MJ_READ when i try to read from serial port

 

But when i am using LabView i am only able to send IRP_MJ_WRITE function using VISA write component (so this one works good), but when i use VISA read component my serial port monitor gives me only IRP_DEVICE_CONTROL. Have you any sugestion where can be problem? I have no idea how to get this IRP_MJ_READ function using LabView VISA component.

0 Kudos
Message 1 of 5
(5,196 Views)
Solution
Accepted by topic author BMAJTZ

Are you monitoring the using PortMon software ? Only thing I can see here is that check the command what you send, there might be some space which you might have introduced while typing,

 

or

 

Are you still running stepper motor control software while running the labview ? In this case there will be conflict.

 

When you are using original stepper motor software and when you send command wirte down the hex value (see in portmon or anyother monitoring software) and try sending same hex values using labview. Sending command, sending hex are same but just give it a try,

 

Use bytes at port function before VISA read to read all the available data.

 

Search for Microcon drivers in Instrument driver network in NI website if you want easy & fast solution.

0 Kudos
Message 2 of 5
(5,194 Views)

I am using only original software or labview (so there is no problem). Hex values are the same in both programs. There is no Microcon drived on NI website.

 

Ok but with thist bytes at port you can have right. But when i use thist function it gives me only zeros. 

0 Kudos
Message 3 of 5
(5,188 Views)

Ok finally your advice leaded to solution. You have right it was because this byte at port. I put this VISA read component intu case structure and i read it only when on serial port are some bytes (bytes at serial port) and this number of bytes i read. And it is working good.  

 

Thank you for thist proposions, it really helped. 

0 Kudos
Message 4 of 5
(5,185 Views)

pls close the thread by clicking on accept this as solution...  all the best

0 Kudos
Message 5 of 5
(5,183 Views)