The manufacturer of the linear slide provides the 2 translational and 3 rotational stiffness values for the carriage on the rail.
You can replace the entire carriage with one node and the rail with another coincident node and put a COMBI250 element between them. Then put the 5 values of stiffness into the Real Constants for this elements. Use a value of 0 for the translational stiffness along the rail.
Under ANSYS Help, go to the Mechanical APDL section and then to the Element Reference to find more information.
The above describes a linear model of the carriage that is very useful for system models where the carriage is a small component of a large system and the important features are the freedom to slide along the rail and stiffness values in the other five DOF.
You said you have to use a nonlinear spring. Why is that? Where did this nonlinear data come from? What does it look like? Since you said you have force-displacement data, then you would use a COMBIN39 element and load the force-displacement data into that element. However, that only provides 1 DOF so you will have to use several of those springs to provide the 5 DOF to support the carriage on the rail. Do you have rotational force-angle data?