LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Protocol SMB

Solved!
Go to solution

Bonjour à tous,

Pour communique avec un serveur , je suis obliger de passer par le Protocol SMB.....

Quelqu'un à une idée de comment faire ça sous LabVIEW???

 

Merci

0 Kudos
Message 1 of 12
(4,778 Views)

Translation:

 

Hello everyone,
To communicate with a server, I am obliged to go through the SMB protocol .....
Anyone have any idea how to do this in LabVIEW ???
 
Thanks
CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 2 of 12
(4,761 Views)

Applications normally don't talk SMB directly. They make use of some API. SMB is nowadays mostly used for file sharing and other similar appliciations and seldom for inter-application communication, at least directly. Things like Distributed COM might be routed through an SMB connection but that is not common nowadays.

Generally if the server implements SMB for file sharing you will need to setup Windows to connect to it properly and simply access the shared file locations with the file IO APIs in LabVIEW. If for whatever strange reasons you really need to directly talk through SMB you are in for a rough ride.

That would mean accessing Windows APIs directly and some of them are pretty nasty in terms of parameters they use, which would require some complicated vodoo in the VI diagram to call those APIs directly with the Call Library Node or the creation of an intermediate DLL in C(++) that you then call with the Call Library Node. The intermediate DLL would translate between the Windows APIs and a more LabVIEW friendly function API. Both solutions will require you to be steadyfast with C programming in order to create a solution that will not just keep crashing more or less randomly.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 3 of 12
(4,745 Views)

Bonjour Rolf,

 

Merci pour ta réponse. Je comprend mieux maintenant....

Donc maintenant je peux dire que le Protocol SMB va utiliser pour le partage de fichier entre le serveur et mon application.

Par contre je trouve pas d'exemple bien expliquer en labview!

 

 

0 Kudos
Message 4 of 12
(4,724 Views)

Why on Earth have you picked something as complicated as protocol SMB for file sharing?

Surely there's another way?

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 5 of 12
(4,722 Views)

Well SMB is still very often at the base of many more simple Windows file sharing solutions. Never mind that it is usually SMB over TCP/IP, since TCP/IP is the ubiquitous low level protocol nowadays. Big changes that if you have a file share on your computer from a Windows server, that you are actually using CIFS (an SMB dialect) for this.

 

And that is already the answer for the OP. Use of the SMB file sharing protocol is completely independent of LabVIEW. As long as the Windows domain configuration is setup to allow access to the remote share location from your current account you can simply address that file share through an UNC name "\\server_name\share_name\path". The LabVIEW path control under Windows supports UNC paths and therefore you simply use Open File to open that path. Or alternatively you map the remote location in Windows to a local device (e.g. "P:\name") and then access it like any other file on your computer.

 

The only possible drawback of this is: if the remote location is not available you can end up with pretty long timeout delays when trying to open a directory or file on it, since the underlying network functions work with a preset timeout interval that you have absolutely no chance to change from the file access API.

 

And if you talk about Linux as client system you would have to make sure that SAMBA is installed (most desktop distributions have that enabled by default), the open source implementation of the Windows SMB client and server and then some more, and configure it such that the remote location is mapped into your file-system by mounting it somewhere into your file-system tree.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 12
(4,720 Views)

Je suis forcé de faire avec ....... j'ai pas d'autre choix ( c'est une condition imposée)

 

0 Kudos
Message 7 of 12
(4,708 Views)

Forced to do what?

 

Describe your problem in more details. What server/hardware? Why SMB? How does your requirements specification look like?

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 8 of 12
(4,705 Views)

Voila !

Le serveur SMB (poste linux) reçoit des fichiers par des instruments chaque 2 à 3 minutes.

J'ai pas le droit de manipuler le serveur. (je ne sait même pas c'est quoi comme serveur).

Mon IHM doit communiquer avec ce serveur pour voir la disponibilité des fichiers et les lire.

Je ne peux changé ni le Protocol ni le serveur. 

0 Kudos
Message 9 of 12
(4,699 Views)

Sounds like someone is being awkward just for the sake of it.

 

Suggest a small program running on the server (could be LabVIEW or not) which checks for new files in a directory on an incoming request and passes the data out to your HMI.

 

They can specify the TCP/IP port or a more suitable coms protocol.

 

If someone is being precious about their server they could even write the code themselves. It looks like making more work than needed and possibly introducing security risks in different areas that will be harder to find if security is the concern.

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 10 of 12
(4,694 Views)