Generating C# code from existing GSD

I have an existing GSD file and I need to create the corresponding C# file to represent the functions.

I know I can use the Excel template to create BOTH the GSD and C# file needed, but I’m not sure how to work with an existing GSD file.

The GSD is 86 lines of text. Seeing as it is rather small, I’ll paste it in code here in case it helps answer my question.

; This GSD allows user to select the exact configuration of its 410-510 instrument
; to do so, the gateway firmware version has to be >= 2.0 and the user software version has to be >= 2.15
; if not, select Module "Profibus Gateway Version < 2.0" 

; GSD revision 2 has been specially done for a system whom string Module strings length description were too long
; Modifications done:
; Text "Gateway Version >= 2.0 - 1 channel" become "1 channel"
; Text "Gateway Version >= 2.0 - 2 channels" become "2 channels"
; Text "Gateway Version >= 2.0 - 3 channels" become "3 channels"

#Profibus_DP
; Revision of the GSD file format
GSD_Revision        = 1
; 
Vendor_Name         = "ORBISPHERE"
Model_Name          = "410-510"
; Revision version of the device
Revision            = "V2.1"
Ident_Number        = 0x3218
Protocol_Ident      = 0
Station_Type        = 0
FMS_supp            = 0
Hardware_Release    = "Revision G"
Software_Release    = "V2.0"
OrderNumber	    	= "V3218"
;
9.6_supp            = 1
19.2_supp           = 1
45.45_supp          = 1
93.75_supp          = 1
187.5_supp          = 1
500_supp            = 1
1.5M_supp           = 1
3M_supp             = 1
6M_supp             = 1
12M_supp            = 1
;
MaxTsdr_9.6         = 60
MaxTsdr_19.2        = 60
MaxTsdr_45.45       = 60
MaxTsdr_93.75       = 60
MaxTsdr_187.5       = 60
MaxTsdr_500         = 100
MaxTsdr_1.5M        = 150
MaxTsdr_3M          = 250
MaxTsdr_6M          = 450
MaxTsdr_12M         = 800
;
Redundancy          = 0
Repeater_Ctrl_Sig   = 2
24V_Pins            = 0
Implementation_Type = "SPC3"
Bitmap_Device	    = "Orbi3218"
;
Freeze_Mode_supp    = 1
Sync_Mode_supp      = 1
Auto_Baud_supp      = 1
Set_Slave_Add_supp  = 0
Min_Slave_Intervall = 1
;
Modular_Station     = 1
Max_Module          = 1		; Only one module can be selected
Max_Input_Len       = 80	; Maximum input length for 3 channels
Max_Output_Len      = 6		; Ouput length is 6 whatever the configuration
Max_Data_Len        = 86	; Maximum is max input + max output
Modul_Offset        = 0
;
Fail_Safe           = 0
Slave_Family        = 5
Max_Diag_Data_Len   = 8
;
;Modules available: only one module can be selected
;
;This module is for Profibus gateway version >= 2.0 AND mono channel instrument for user software version = 2.15 or >= 3.0
Module 		    = "1 channel" 0x94,0x9F,0x96,0x95,0xA5
EndModule
;This module is for Profibus gateway version >= 2.0 AND 2-channel instrument for user software version = 2.15 or >= 3.0
Module 		    = "2 channels" 0x94,0x9F,0x96,0x9F,0x96,0x95,0xA5
EndModule
;This module is for Profibus gateway version >= 2.0 AND 3-channel instrument for user software version = 2.15 or >= 3.0
Module 		    = "3 channels" 0x94,0x9F,0x96,0x9F,0x96,0x9F,0x96,0x95,0xA5
EndModule
;This module is for Profibus gateway version < 2.0 AND/OR instrument for user software version <= 2.14
Module 		    = "Gateway Version < 2.0" 0x94,0x9F,0x96,0x9F,0x96,0x9F,0x96,0x95,0xA5
EndModule
;

I have also included the table of address-to-measurement information.

Hello,

I apologize, but I am not quite sure what you are working with or trying to accomplish. What do you intend to do with the C# code?

We have an instrument that we are trying to read data from using PROFIBUS via your Anybus AB9071-B gateway.

I have included the manual page from the instrument that outlines the buffer from the instrument and the manufacturer’s GSD file.

I have no problem with the C# once the interface between the gateway and device is defined. However, all of the examples I have seen use the Excel template to create the GSD file, whereas, I have an existing GSD file.

(I have a very strange feeling we bought 3 of the wrong product–but I sure hope not)

I understand, sorry for the confusion!

I do unfortunately think you may have the wrong product. This Gateway is a PROFIBUS slave is is meant to connect to a PROFIBUS Master device. This being said, you are sure that the other PROFIBUS instrument is a slave?

I just read the manual…It is definitely a slave device.

Do you offer a device to read from a PROFIBUS slave via .NET?

Unfortunately we do not have a PROFIBUS Master to .NET gateway, sorry for the inconvenience!

Actually I need a PROFIBUS “Slave” to .NET gateway.

What about translating PROFIBUS to Modbus? I can easily read Modbus from .NET.

Do you know of any options from any other manufacturers? (You can DM me those if you have them)

We do have a Modbus TCP or Modbus RTU to PROFIBUS Master gateway. However this does not really take .NET into account. Here is information on these gateways,

https://www.anybus.com/products/gateway-index/anybus-xgateway/detail/anybus-x-gateway-profibus-master-modbus-tcp-server

https://www.anybus.com/products/gateway-index/anybus-xgateway/detail/anybus-x-gateway-profibus-master-modbus-tcp-server

I actually do not really know about other products/vendors that offer .NET capable devices.

1 Like

If it is Modbus, then I know how to get the data…I wouldn’t need any .NET layer.

Are you sure that if I have a PROFIBUS DP slave, I can connect it to this and then read data from it using Modbus RTU?

Also, I’ll need ordering information.

Hello,

Just to touch base, the products mentioned above should work for your application. Thanks for your inquiry!

Nick